package com.bawei.week3.fragment;
import android.support.design.widget.TabLayout;
import android.support.v4.app.Fragment;
import android.support.v4.view.ViewPager;
import android.view.View;
import com.bawei.week3.R;
import com.bawei.week3.adapter.TabAdapter;
import com.bawei.week3.base.BaseFragment;
import com.bawei.week3.tab.Tab01;
import com.bawei.week3.tab.Tab02;
import com.bawei.week3.tab.Tab03;
import com.bawei.week3.tab.Tab04;
import com.bawei.week3.tab.Tab05;
import com.bawei.week3.tab.Tab06;
import java.util.ArrayList;
/**
-
@Author:南方小酒馆°
-
@E-mail:
-
@Date:2019/3/1 15:43
-
@Description:描述信息
*/
public class Frag01 extends BaseFragment {private TabLayout tab;
private ViewPager pager;@Override
protected int bindLayout() {
return R.layout.frag01;
}@Override
protected void initView() {
tab = bindView(R.id.tab);
pager = bindView(R.id.pager);
}@Override
protected void initData() {String str[] = {"我们","都在","爱情","里少","一点","天份"}; ArrayList<Fragment> list = new ArrayList<>(); list.add(new Tab01()); list.add(new Tab02()); list.add(new Tab03()); list.add(new Tab04()); list.add(new Tab05()); list.add(new Tab06()); TabAdapter adapter = new TabAdapter(getActivity().getSupportFragmentManager(),str,list); pager.setAdapter(adapter); tab.setupWithViewPager(pager);
}
@Override
protected void bindEvent() {}
}