use of com.shiming.andrioddesignpattern.ui.FactoryMethodModelFragment in project AndriodDesignPattern by Shimingli.
the class CreatorModelActivity method onCreate.
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.creator_model_activity_layout);
ViewPager pager = (ViewPager) findViewById(R.id.viewpager);
SlidingTabLayout tab = (SlidingTabLayout) findViewById(R.id.tap);
mTitles = new String[] { this.getResources().getString(R.string.all_order_tab1), this.getResources().getString(R.string.all_order_tab2), this.getResources().getString(R.string.all_order_tab3), this.getResources().getString(R.string.all_order_tab4) };
mFragments.add(new FactoryMethodModelFragment());
mFragments.add(new SingletonModelFragment());
mFragments.add(new BuilderModelFragment());
mFragments.add(new ProtoTypeModelFragment());
mAdapter = new MyPagerAdapter(getSupportFragmentManager());
pager.setAdapter(mAdapter);
tab.setViewPager(pager);
}
Aggregations