Search in sources :

Example 1 with StateModelFragment

use of com.shiming.andrioddesignpattern.ui.StateModelFragment in project AndriodDesignPattern by Shimingli.

the class BehaviorModelActivity method onCreate.

@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.behavioral_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_tab16), this.getResources().getString(R.string.all_order_tab17), this.getResources().getString(R.string.all_order_tab18), this.getResources().getString(R.string.all_order_tab19), this.getResources().getString(R.string.all_order_tab20), this.getResources().getString(R.string.all_order_tab21), this.getResources().getString(R.string.all_order_tab22), this.getResources().getString(R.string.all_order_tab23), this.getResources().getString(R.string.all_order_tab24), this.getResources().getString(R.string.all_order_tab25) };
    mFragments.add(new StrategyModelFragment());
    mFragments.add(new TemplateModelFragment());
    mFragments.add(new ObserverModelFragment());
    mFragments.add(new IteratorModelFragment());
    mFragments.add(new ChainOfResponsibilityFragment());
    mFragments.add(new CommandPatternModelFragment());
    mFragments.add(new MementoModelFragment());
    mFragments.add(new StateModelFragment());
    mFragments.add(new VisitorPatternModelFragment());
    mFragments.add(new MediatorPatternModelFragment());
    mAdapter = new MyPagerAdapter(getSupportFragmentManager());
    pager.setAdapter(mAdapter);
    tab.setViewPager(pager);
}
Also used : TemplateModelFragment(com.shiming.andrioddesignpattern.ui.TemplateModelFragment) MementoModelFragment(com.shiming.andrioddesignpattern.ui.MementoModelFragment) SlidingTabLayout(com.flyco.tablayout.SlidingTabLayout) ChainOfResponsibilityFragment(com.shiming.andrioddesignpattern.ui.ChainOfResponsibilityFragment) StrategyModelFragment(com.shiming.andrioddesignpattern.ui.StrategyModelFragment) MediatorPatternModelFragment(com.shiming.andrioddesignpattern.mediator_Pattern.MediatorPatternModelFragment) ViewPager(android.support.v4.view.ViewPager) IteratorModelFragment(com.shiming.andrioddesignpattern.ui.IteratorModelFragment) VisitorPatternModelFragment(com.shiming.andrioddesignpattern.Visitor_pattern.VisitorPatternModelFragment) ObserverModelFragment(com.shiming.andrioddesignpattern.ui.ObserverModelFragment) CommandPatternModelFragment(com.shiming.andrioddesignpattern.ui.CommandPatternModelFragment) StateModelFragment(com.shiming.andrioddesignpattern.ui.StateModelFragment)

Aggregations

ViewPager (android.support.v4.view.ViewPager)1 SlidingTabLayout (com.flyco.tablayout.SlidingTabLayout)1 VisitorPatternModelFragment (com.shiming.andrioddesignpattern.Visitor_pattern.VisitorPatternModelFragment)1 MediatorPatternModelFragment (com.shiming.andrioddesignpattern.mediator_Pattern.MediatorPatternModelFragment)1 ChainOfResponsibilityFragment (com.shiming.andrioddesignpattern.ui.ChainOfResponsibilityFragment)1 CommandPatternModelFragment (com.shiming.andrioddesignpattern.ui.CommandPatternModelFragment)1 IteratorModelFragment (com.shiming.andrioddesignpattern.ui.IteratorModelFragment)1 MementoModelFragment (com.shiming.andrioddesignpattern.ui.MementoModelFragment)1 ObserverModelFragment (com.shiming.andrioddesignpattern.ui.ObserverModelFragment)1 StateModelFragment (com.shiming.andrioddesignpattern.ui.StateModelFragment)1 StrategyModelFragment (com.shiming.andrioddesignpattern.ui.StrategyModelFragment)1 TemplateModelFragment (com.shiming.andrioddesignpattern.ui.TemplateModelFragment)1