use of com.rengwuxian.rxjavasamples.module.cache_6.CacheFragment in project RxJavaSamples by rengwuxian.
the class MainActivity method onCreate.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
ButterKnife.bind(this);
setSupportActionBar(toolBar);
viewPager.setAdapter(new FragmentPagerAdapter(getFragmentManager()) {
@Override
public int getCount() {
return 6;
}
@Override
public Fragment getItem(int position) {
switch(position) {
case 0:
return new ElementaryFragment();
case 1:
return new MapFragment();
case 2:
return new ZipFragment();
case 3:
return new TokenFragment();
case 4:
return new TokenAdvancedFragment();
case 5:
return new CacheFragment();
default:
return new ElementaryFragment();
}
}
@Override
public CharSequence getPageTitle(int position) {
switch(position) {
case 0:
return getString(R.string.title_elementary);
case 1:
return getString(R.string.title_map);
case 2:
return getString(R.string.title_zip);
case 3:
return getString(R.string.title_token);
case 4:
return getString(R.string.title_token_advanced);
case 5:
return getString(R.string.title_cache);
default:
return getString(R.string.title_elementary);
}
}
});
tabLayout.setupWithViewPager(viewPager);
}
Aggregations