diff options
author | Scott Jackson <daneren2005@gmail.com> | 2012-09-30 16:42:14 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2012-09-30 16:42:14 -0700 |
commit | aea0ce8ac28c32e14f91a5efc3558072788794e0 (patch) | |
tree | d11f2acab7a0f85758bf906eee705c6e41d33d1c /subsonic-android/src/github | |
parent | 3abd47156429f5657fd58dfb432f037b9290c948 (diff) | |
download | dsub-aea0ce8ac28c32e14f91a5efc3558072788794e0.tar.gz dsub-aea0ce8ac28c32e14f91a5efc3558072788794e0.tar.bz2 dsub-aea0ce8ac28c32e14f91a5efc3558072788794e0.zip |
Moved playlist context to context_menu + added download/cache items to it
Diffstat (limited to 'subsonic-android/src/github')
-rw-r--r-- | subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java b/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java index f515d5be..6afefc5b 100644 --- a/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java +++ b/subsonic-android/src/github/daneren2005/dsub/activity/SelectPlaylistActivity.java @@ -21,12 +21,8 @@ package github.daneren2005.dsub.activity; import android.content.Intent; import android.os.Bundle; -import android.view.ContextMenu; -import android.view.Menu; -import android.view.MenuItem; -import android.view.View; +import android.view.*; import android.widget.AdapterView; -import android.widget.ImageButton; import android.widget.ListView; import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.Playlist; @@ -44,6 +40,8 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt private static final int MENU_ITEM_PLAY_ALL = 1; private static final int MENU_ITEM_PLAY_SHUFFLED = 2; + private static final int MENU_ITEM_DOWNLOAD = 3; + private static final int MENU_ITEM_CACHE = 4; private ListView list; private View emptyTextView; @@ -123,8 +121,9 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt @Override public void onCreateContextMenu(ContextMenu menu, View view, ContextMenu.ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, view, menuInfo); - menu.add(Menu.NONE, MENU_ITEM_PLAY_ALL, MENU_ITEM_PLAY_ALL, R.string.common_play_now); - menu.add(Menu.NONE, MENU_ITEM_PLAY_SHUFFLED, MENU_ITEM_PLAY_SHUFFLED, R.string.common_play_shuffled); + + MenuInflater inflater = getMenuInflater(); + inflater.inflate(R.menu.select_playlist_context, menu); } @Override @@ -134,14 +133,20 @@ public class SelectPlaylistActivity extends SubsonicTabActivity implements Adapt Intent intent; switch (menuItem.getItemId()) { - case MENU_ITEM_PLAY_ALL: + case R.id.playlist_menu_download: + downloadRecursively(playlist.getId(), false, true, false, false, true); + break; + case R.id.playlist_menu_pin: + downloadRecursively(playlist.getId(), true, true, false, false, true); + break; + case R.id.playlist_menu_play_now: intent = new Intent(SelectPlaylistActivity.this, SelectAlbumActivity.class); intent.putExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID, playlist.getId()); intent.putExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME, playlist.getName()); intent.putExtra(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); Util.startActivityWithoutTransition(SelectPlaylistActivity.this, intent); break; - case MENU_ITEM_PLAY_SHUFFLED: + case R.id.playlist_menu_play_shuffled: intent = new Intent(SelectPlaylistActivity.this, SelectAlbumActivity.class); intent.putExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID, playlist.getId()); intent.putExtra(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME, playlist.getName()); |