Search in sources :

Example 1 with MainPageAdapter

use of me.yluo.ruisiapp.adapter.MainPageAdapter in project Ruisi by freedom10086.

the class HomeActivity method initViewpager.

private void initViewpager() {
    viewPager = findViewById(R.id.view_pager);
    viewPager.setOffscreenPageLimit(4);
    viewPager.addOnPageChangeListener(this);
    fragments.add(new FrageForums());
    fragments.add(new FrageHotsNews());
    fragments.add(FrageMessage.newInstance());
    fragments.add(new FragmentMy());
    MainPageAdapter adapter = new MainPageAdapter(getSupportFragmentManager(), fragments);
    viewPager.setAdapter(adapter);
}
Also used : FragmentMy(me.yluo.ruisiapp.fragment.FragmentMy) FrageForums(me.yluo.ruisiapp.fragment.FrageForums) FrageHotsNews(me.yluo.ruisiapp.fragment.FrageHotsNews) MainPageAdapter(me.yluo.ruisiapp.adapter.MainPageAdapter)

Aggregations

MainPageAdapter (me.yluo.ruisiapp.adapter.MainPageAdapter)1 FrageForums (me.yluo.ruisiapp.fragment.FrageForums)1 FrageHotsNews (me.yluo.ruisiapp.fragment.FrageHotsNews)1 FragmentMy (me.yluo.ruisiapp.fragment.FragmentMy)1