Search in sources :

Example 1 with ShuffleAllPlaylist

use of com.kabouzeid.gramophone.model.smartplaylist.ShuffleAllPlaylist in project Phonograph by kabouzeid.

the class AppShortcutLauncherActivity method onCreate.

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    int shortcutType = SHORTCUT_TYPE_NONE;
    // Set shortcutType from the intent extras
    Bundle extras = getIntent().getExtras();
    if (extras != null) {
        // noinspection WrongConstant
        shortcutType = extras.getInt(KEY_SHORTCUT_TYPE, SHORTCUT_TYPE_NONE);
    }
    switch(shortcutType) {
        case SHORTCUT_TYPE_SHUFFLE_ALL:
            startServiceWithPlaylist(MusicService.SHUFFLE_MODE_SHUFFLE, new ShuffleAllPlaylist(getApplicationContext()));
            DynamicShortcutManager.reportShortcutUsed(this, ShuffleAllShortcutType.getId());
            break;
        case SHORTCUT_TYPE_TOP_TRACKS:
            startServiceWithPlaylist(MusicService.SHUFFLE_MODE_NONE, new MyTopTracksPlaylist(getApplicationContext()));
            DynamicShortcutManager.reportShortcutUsed(this, TopTracksShortcutType.getId());
            break;
        case SHORTCUT_TYPE_LAST_ADDED:
            startServiceWithPlaylist(MusicService.SHUFFLE_MODE_NONE, new LastAddedPlaylist(getApplicationContext()));
            DynamicShortcutManager.reportShortcutUsed(this, LastAddedShortcutType.getId());
            break;
    }
    finish();
}
Also used : LastAddedPlaylist(com.kabouzeid.gramophone.model.smartplaylist.LastAddedPlaylist) Bundle(android.os.Bundle) ShuffleAllPlaylist(com.kabouzeid.gramophone.model.smartplaylist.ShuffleAllPlaylist) MyTopTracksPlaylist(com.kabouzeid.gramophone.model.smartplaylist.MyTopTracksPlaylist)

Aggregations

Bundle (android.os.Bundle)1 LastAddedPlaylist (com.kabouzeid.gramophone.model.smartplaylist.LastAddedPlaylist)1 MyTopTracksPlaylist (com.kabouzeid.gramophone.model.smartplaylist.MyTopTracksPlaylist)1 ShuffleAllPlaylist (com.kabouzeid.gramophone.model.smartplaylist.ShuffleAllPlaylist)1