Search in sources :

Example 1 with SlidingTabFragment

use of cn.edu.cqupt.nmid.headline.ui.fragment.SlidingTabFragment in project nmid-headline by miao1007.

the class HomeActivity method onNavigationDrawerItemSelected.

@Override
public void onNavigationDrawerItemSelected(int position) {
    FragmentManager fragmentManager = getSupportFragmentManager();
    Fragment fragment = null;
    switch(position) {
        case 0:
            fragment = new SlidingTabFragment();
            break;
        case 1:
            fragment = new ImagesFeedFragment();
            break;
        case 2:
            fragment = new FavFeedFragment();
            break;
    }
    if (fragment != null) {
        fragmentManager.beginTransaction().replace(R.id.base_fragment_container, fragment).commit();
    }
}
Also used : FragmentManager(android.support.v4.app.FragmentManager) ImagesFeedFragment(cn.edu.cqupt.nmid.headline.ui.fragment.ImagesFeedFragment) FavFeedFragment(cn.edu.cqupt.nmid.headline.ui.fragment.base.FavFeedFragment) SlidingTabFragment(cn.edu.cqupt.nmid.headline.ui.fragment.SlidingTabFragment) NavigationDrawerFragment(cn.edu.cqupt.nmid.headline.ui.fragment.NavigationDrawerFragment) ImagesFeedFragment(cn.edu.cqupt.nmid.headline.ui.fragment.ImagesFeedFragment) Fragment(android.support.v4.app.Fragment) FavFeedFragment(cn.edu.cqupt.nmid.headline.ui.fragment.base.FavFeedFragment) SlidingTabFragment(cn.edu.cqupt.nmid.headline.ui.fragment.SlidingTabFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)1 FragmentManager (android.support.v4.app.FragmentManager)1 ImagesFeedFragment (cn.edu.cqupt.nmid.headline.ui.fragment.ImagesFeedFragment)1 NavigationDrawerFragment (cn.edu.cqupt.nmid.headline.ui.fragment.NavigationDrawerFragment)1 SlidingTabFragment (cn.edu.cqupt.nmid.headline.ui.fragment.SlidingTabFragment)1 FavFeedFragment (cn.edu.cqupt.nmid.headline.ui.fragment.base.FavFeedFragment)1