导航菜单

页面标题

页面副标题

爱心e站 v1.0.0 - RehabilitativeArchivesActivity.java 源代码

正在查看: 爱心e站 v1.0.0 应用的 RehabilitativeArchivesActivity.java JAVA 源代码文件

本页面展示 JAVA 反编译生成的源代码文件,支持语法高亮显示。 仅供安全研究与技术分析使用,严禁用于任何非法用途。请遵守相关法律法规。


package com.newheyd.JZKFcanjiren.Activity;

import android.os.Bundle;
import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;
import com.newheyd.JZKFcanjiren.Adapter.TabAdapter;
import com.newheyd.JZKFcanjiren.BaseFragment;
import com.newheyd.JZKFcanjiren.BaseFragmentActiviy;
import com.newheyd.JZKFcanjiren.Bean.TabItem;
import com.newheyd.JZKFcanjiren.Fragment.FragmentBaseInfo;
import com.newheyd.JZKFcanjiren.Fragment.FragmentServiceList;
import com.newheyd.JZKFcanjiren.R;
import com.newheyd.JZKFcanjiren.Utils.StastisticUtil;
import com.newheyd.JZKFcanjiren.Utils.locationUtil.LocationAddrUtil;
import com.newheyd.JZKFcanjiren.View.TitleView;
import com.newheyd.JZKFcanjiren.model.BaseResult;
import com.newheyd.JZKFcanjiren.net.NewHYTask;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;

public class RehabilitativeArchivesActivity extends BaseFragmentActiviy {
    private TabAdapter adapter;
    private TabLayout tab;
    private ArrayList<TabItem> tabs = new ArrayList<>();
    private TitleView titleView;
    private ViewPager viewpager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        setContentView(R.layout.activity_disabled_lifecircle);
        super.onCreate(savedInstanceState);
        initViewPager();
        goStatistics();
    }

    public void goStatistics() {
        HashMap<String, String> map = LocationAddrUtil.getInstance().getLocationParam(this.mContext);
        StastisticUtil.getInstance().onEvent(this.mContext, "RehabilitativeArchivesActivity", map);
    }

    @Override
    public void onResponseBefore(NewHYTask task) {
    }

    @Override
    public void onResponseAfter(NewHYTask task) {
    }

    @Override
    public void onResponseSuccessful(NewHYTask task, BaseResult object) {
    }

    public void initViewPager() {
        TabItem tabBaseInfo = new TabItem("1", "基本信息");
        this.tabs.add(tabBaseInfo);
        TabItem tabRehabilitation = new TabItem("2", "康复需求");
        this.tabs.add(tabRehabilitation);
        TabItem tabEducation = new TabItem("3", "辅具器具申请记录");
        this.tabs.add(tabEducation);
        TabItem tabJob = new TabItem("4", "辅具补贴申请");
        this.tabs.add(tabJob);
        List<BaseFragment> fragments = new ArrayList<>();
        BaseFragment fragmentBaseInfo = FragmentBaseInfo.newInstance(tabBaseInfo);
        BaseFragment fragmentRehabilitation = FragmentServiceList.newInstance(tabRehabilitation);
        BaseFragment fragmentEducation = FragmentServiceList.newInstance(tabEducation);
        BaseFragment fragmentJob = FragmentServiceList.newInstance(tabJob);
        fragments.add(fragmentBaseInfo);
        fragments.add(fragmentRehabilitation);
        fragments.add(fragmentEducation);
        fragments.add(fragmentJob);
        this.adapter = new TabAdapter(getSupportFragmentManager(), fragments, this.tabs);
        this.viewpager.setAdapter(this.adapter);
        this.tab.setupWithViewPager(this.viewpager);
        this.tab.setTabMode(0);
    }

    @Override
    public void onResponseError(NewHYTask task, BaseResult object) {
    }

    @Override
    public void onServerError(NewHYTask task, int failedType) {
    }

    @Override
    public void initViews() {
        this.titleView = (TitleView) findViewById(R.id.titleview_tools);
        this.tab = (TabLayout) findViewById(R.id.tab);
        this.viewpager = (ViewPager) findViewById(R.id.viewpager);
    }

    @Override
    public void getExtraParam() {
    }

    @Override
    public void setListener() {
        this.titleView.setOnTitleClik(new TitleView.BackListenner() {
            @Override
            public void BackSet() {
                RehabilitativeArchivesActivity.this.finish();
            }
        }, null);
    }
}