Search in sources :

Example 1 with QueueFragment

use of de.danoeh.antennapod.fragment.QueueFragment in project AntennaPod by AntennaPod.

the class MainActivity method loadFragment.

public void loadFragment(String tag, Bundle args) {
    Log.d(TAG, "loadFragment(tag: " + tag + ", args: " + args + ")");
    Fragment fragment = null;
    switch(tag) {
        case QueueFragment.TAG:
            fragment = new QueueFragment();
            break;
        case EpisodesFragment.TAG:
            fragment = new EpisodesFragment();
            break;
        case DownloadsFragment.TAG:
            fragment = new DownloadsFragment();
            break;
        case PlaybackHistoryFragment.TAG:
            fragment = new PlaybackHistoryFragment();
            break;
        case AddFeedFragment.TAG:
            fragment = new AddFeedFragment();
            break;
        case SubscriptionFragment.TAG:
            SubscriptionFragment subscriptionFragment = new SubscriptionFragment();
            fragment = subscriptionFragment;
            break;
        default:
            // default to the queue
            tag = QueueFragment.TAG;
            fragment = new QueueFragment();
            args = null;
            break;
    }
    currentTitle = navAdapter.getLabel(tag);
    getSupportActionBar().setTitle(currentTitle);
    saveLastNavFragment(tag);
    if (args != null) {
        fragment.setArguments(args);
    }
    loadFragment(fragment);
}
Also used : DownloadsFragment(de.danoeh.antennapod.fragment.DownloadsFragment) AddFeedFragment(de.danoeh.antennapod.fragment.AddFeedFragment) PlaybackHistoryFragment(de.danoeh.antennapod.fragment.PlaybackHistoryFragment) QueueFragment(de.danoeh.antennapod.fragment.QueueFragment) EpisodesFragment(de.danoeh.antennapod.fragment.EpisodesFragment) QueueFragment(de.danoeh.antennapod.fragment.QueueFragment) Fragment(android.support.v4.app.Fragment) DownloadsFragment(de.danoeh.antennapod.fragment.DownloadsFragment) ItemlistFragment(de.danoeh.antennapod.fragment.ItemlistFragment) ExternalPlayerFragment(de.danoeh.antennapod.fragment.ExternalPlayerFragment) SubscriptionFragment(de.danoeh.antennapod.fragment.SubscriptionFragment) PlaybackHistoryFragment(de.danoeh.antennapod.fragment.PlaybackHistoryFragment) EpisodesFragment(de.danoeh.antennapod.fragment.EpisodesFragment) AddFeedFragment(de.danoeh.antennapod.fragment.AddFeedFragment) SubscriptionFragment(de.danoeh.antennapod.fragment.SubscriptionFragment)

Aggregations

Fragment (android.support.v4.app.Fragment)1 AddFeedFragment (de.danoeh.antennapod.fragment.AddFeedFragment)1 DownloadsFragment (de.danoeh.antennapod.fragment.DownloadsFragment)1 EpisodesFragment (de.danoeh.antennapod.fragment.EpisodesFragment)1 ExternalPlayerFragment (de.danoeh.antennapod.fragment.ExternalPlayerFragment)1 ItemlistFragment (de.danoeh.antennapod.fragment.ItemlistFragment)1 PlaybackHistoryFragment (de.danoeh.antennapod.fragment.PlaybackHistoryFragment)1 QueueFragment (de.danoeh.antennapod.fragment.QueueFragment)1 SubscriptionFragment (de.danoeh.antennapod.fragment.SubscriptionFragment)1