Search in sources :

Example 1 with SpringIndicator

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);
}
Also used : PagerModelManager(github.chenupt.multiplemodel.viewpager.PagerModelManager) ModelPagerAdapter(github.chenupt.multiplemodel.viewpager.ModelPagerAdapter) SpringIndicator(github.chenupt.springindicator.SpringIndicator) Toolbar(android.support.v7.widget.Toolbar)

Aggregations

Toolbar (android.support.v7.widget.Toolbar)1 ModelPagerAdapter (github.chenupt.multiplemodel.viewpager.ModelPagerAdapter)1 PagerModelManager (github.chenupt.multiplemodel.viewpager.PagerModelManager)1 SpringIndicator (github.chenupt.springindicator.SpringIndicator)1