use of github.chenupt.springindicator.SpringIndicator in project SpringIndicator by chenupt.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
viewPager = (ScrollerViewPager) findViewById(R.id.view_pager);
SpringIndicator springIndicator = (SpringIndicator) findViewById(R.id.indicator);
Toolbar toolbar = (Toolbar) findViewById(R.id.tool_bar);
setSupportActionBar(toolbar);
PagerModelManager manager = new PagerModelManager();
manager.addCommonFragment(GuideFragment.class, getBgRes(), getTitles());
ModelPagerAdapter adapter = new ModelPagerAdapter(getSupportFragmentManager(), manager);
viewPager.setAdapter(adapter);
viewPager.fixScrollSpeed();
// just set viewPager
springIndicator.setViewPager(viewPager);
}
Aggregations