use of me.majiajie.pagerbottomtabstriptest.custom.OnlyTextTab in project PagerBottomTabStrip by tyzlmjj.
the class VerticalCustomActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_vertical_custom);
PageNavigationView pageNavigationView = findViewById(R.id.tab);
mNavigationController = pageNavigationView.custom().addItem(new OnlyTextTab(this, "A")).addItem(new OnlyTextTab(this, "B")).addItem(new OnlyTextTab(this, "C")).addItem(new OnlyTextTab(this, "D")).addItem(new OnlyTextTab(this, "E")).addItem(new OnlyTextTab(this, "F")).addItem(new OnlyTextTab(this, "G")).addItem(new OnlyTextTab(this, "H")).addItem(new OnlyTextTab(this, "I")).addItem(new OnlyTextTab(this, "J")).addItem(new OnlyTextTab(this, "K")).addItem(new OnlyTextTab(this, "L")).addItem(new OnlyTextTab(this, "M")).addItem(new OnlyTextTab(this, "N")).addItem(new OnlyTextTab(this, "O")).enableVerticalLayout().build();
ViewPager viewPager = findViewById(R.id.viewPager);
viewPager.setAdapter(new MyViewPagerAdapter(getSupportFragmentManager(), mNavigationController.getItemCount()));
// 自动适配ViewPager页面切换
mNavigationController.setupWithViewPager(viewPager);
}
Aggregations