package com.sheep.gamegroup.view.activity;

import android.support.design.widget.TabLayout;
import android.support.v4.view.ViewPager;

import com.sheep.gamegroup.absBase.BaseActivity;
import com.sheep.gamegroup.util.CommonUtil;
import com.sheep.gamegroup.view.adapter.TitleFragmentListAdapter;
import com.sheep.gamegroup.view.fragment.FgtGameFocusList;
import com.sheep.gamegroup.view.fragment.FgtUserFocusLogList;
import com.sheep.jiuyan.samllsheep.R;
import com.sheep.jiuyan.samllsheep.utils.TitleBarUtils;

import butterknife.BindView;

/**
 * Created by realicing on 2018/11/22.
 * realicing@sina.com
 * 小绵羊3.4.5新界面--我的关注
 */
public class ActMyFocus extends BaseActivity {
    @Override
    protected int getLayoutId() {
        return R.layout.common_tab_vp;
    }

    @BindView(R.id.indicator)
    TabLayout indicator;
    @BindView(R.id.pager)
    ViewPager pager;
    private TitleFragmentListAdapter mAdapter;

    @Override
    public void initView() {
        TitleBarUtils.getInstance().setTitle(this, "我的关注")
                .setTitleFinish(this);

    }


    @Override
    public void initData() {
        mAdapter = new TitleFragmentListAdapter(getSupportFragmentManager());
        mAdapter.add(new FgtGameFocusList(), "游戏");
        mAdapter.add(new FgtUserFocusLogList(), "人员");
        pager.setAdapter(mAdapter);
        indicator.setupWithViewPager(pager);
        pager.setCurrentItem(0);
        pager.setOffscreenPageLimit(mAdapter.getCount());
        CommonUtil.getInstance().reflex(indicator, this);
    }
}
