use of com.shizhefei.test.view.adapters.PagesAdapter in project MVCHelper by LuckyJayce.
the class CoolActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_more_views);
Indicator indicator = (Indicator) findViewById(R.id.moreviews_indicatorView);
ViewPager viewPager = (ViewPager) findViewById(R.id.moreviews_viewPager);
headTextView = (TextView) findViewById(R.id.moreviews_headtext_textView);
Class[] fragments = { StateHeaderFragment.class, JellyHeaderFragment.class, MaterialHeaderFragment.class, PinContentMaterialHeaderFragment.class };
indicator.setScrollBar(new ColorBar(this, ContextCompat.getColor(this, R.color.primary), DisplayUtil.dipToPix(this, 3)));
indicator.setOnTransitionListener(new OnTransitionTextListener().setColor(Color.BLACK, Color.GRAY));
viewPager.setOffscreenPageLimit(2);
indicatorViewPager = new IndicatorViewPager(indicator, viewPager);
indicatorViewPager.setAdapter(pagesAdapter = new PagesAdapter(getSupportFragmentManager(), fragments));
}
Aggregations