Search in sources :

Example 1 with CharactersFragment

use of com.karumi.rosie.sample.characters.view.fragment.CharactersFragment in project Rosie by Karumi.

the class MainActivity method initializeViewPager.

private void initializeViewPager() {
    adapter = new FragmentAdapter(getFragmentManager());
    viewPager.setAdapter(adapter);
    Fragment charactersFragment = new CharactersFragment();
    Fragment comicsFragment = new ComicSeriesFragment();
    adapter.addFragment(charactersFragment, getString(R.string.characters_page_title));
    adapter.addFragment(comicsFragment, getString(R.string.comic_series_page_title));
    adapter.notifyDataSetChanged();
    pagerTabView.setupWithViewPager(viewPager);
}
Also used : CharactersFragment(com.karumi.rosie.sample.characters.view.fragment.CharactersFragment) ComicSeriesFragment(com.karumi.rosie.sample.comics.view.fragment.ComicSeriesFragment) Fragment(android.app.Fragment) ComicSeriesFragment(com.karumi.rosie.sample.comics.view.fragment.ComicSeriesFragment) CharactersFragment(com.karumi.rosie.sample.characters.view.fragment.CharactersFragment) FragmentAdapter(com.karumi.rosie.sample.main.view.adapter.FragmentAdapter)

Aggregations

Fragment (android.app.Fragment)1 CharactersFragment (com.karumi.rosie.sample.characters.view.fragment.CharactersFragment)1 ComicSeriesFragment (com.karumi.rosie.sample.comics.view.fragment.ComicSeriesFragment)1 FragmentAdapter (com.karumi.rosie.sample.main.view.adapter.FragmentAdapter)1