diff options
Diffstat (limited to 'app/src/main')
25 files changed, 461 insertions, 102 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java index 38bd483d..75b1562f 100644 --- a/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java +++ b/app/src/main/java/github/daneren2005/dsub/adapter/SectionAdapter.java @@ -401,7 +401,7 @@ public abstract class SectionAdapter<T> extends RecyclerView.Adapter<UpdateViewH public boolean onCreateActionMode(ActionMode mode, Menu menu) { currentActionMode = mode; onCreateActionModeMenu(menu, mode.getMenuInflater()); - MenuUtil.hideMenuItems(context, menu); + MenuUtil.hideMenuItems(context, menu, updateView); T item = holder.getItem(); selected.add(item); diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 68ade3cc..f312675f 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -555,15 +555,20 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis menu.findItem(R.id.menu_show_artist).setVisible(false); } - MenuUtil.hideMenuItems(context, menu); + MenuUtil.hideMenuItems(context, menu, updateView); } @Override public boolean onContextItemSelected(MenuItem menuItem, UpdateView<DownloadFile> updateView, DownloadFile downloadFile) { + if(onContextItemSelected(menuItem, downloadFile)) { + return true; + } + return menuItemSelected(menuItem.getItemId(), downloadFile); } private boolean menuItemSelected(int menuItemId, final DownloadFile song) { + List<Entry> songs; switch (menuItemId) { case R.id.menu_show_album: case R.id.menu_show_artist: Entry entry = song.getSong(); @@ -629,11 +634,6 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis replaceFragment(fragment); return true; } - case R.id.menu_delete: - List<Entry> songs = new ArrayList<Entry>(1); - songs.add(song.getSong()); - getDownloadService().delete(songs); - return true; case R.id.menu_remove_all: Util.confirmDialog(context, R.string.download_menu_remove_all, "", new DialogInterface.OnClickListener() { @Override diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java index d992319b..ceca2bff 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectBookmarkFragment.java @@ -48,7 +48,7 @@ public class SelectBookmarkFragment extends SelectRecyclerFragment<MusicDirector @Override public void onCreateContextMenu(Menu menu, MenuInflater menuInflater, UpdateView<MusicDirectory.Entry> updateView, MusicDirectory.Entry item) { menuInflater.inflate(R.menu.select_bookmark_context, menu); - MenuUtil.hideMenuItems(context, menu); + MenuUtil.hideMenuItems(context, menu, updateView); } @Override diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java index 543dcb26..ab22c808 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SelectPlaylistFragment.java @@ -76,13 +76,41 @@ public class SelectPlaylistFragment extends SelectRecyclerFragment<Playlist> { @Override public boolean onContextItemSelected(MenuItem menuItem, UpdateView<Playlist> updateView, Playlist playlist) { + SubsonicFragment fragment; + Bundle args; + FragmentTransaction trans; + switch (menuItem.getItemId()) { + case R.id.playlist_menu_download: + downloadPlaylist(playlist.getId(), playlist.getName(), false, true, false, false, true); + break; case R.id.playlist_menu_sync: syncPlaylist(playlist); break; case R.id.playlist_menu_stop_sync: stopSyncPlaylist(playlist); break; + case R.id.playlist_menu_play_now: + fragment = new SelectDirectoryFragment(); + args = new Bundle(); + args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID, playlist.getId()); + args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME, playlist.getName()); + args.putBoolean(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); + fragment.setArguments(args); + + replaceFragment(fragment); + break; + case R.id.playlist_menu_play_shuffled: + fragment = new SelectDirectoryFragment(); + args = new Bundle(); + args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_ID, playlist.getId()); + args.putString(Constants.INTENT_EXTRA_NAME_PLAYLIST_NAME, playlist.getName()); + args.putBoolean(Constants.INTENT_EXTRA_NAME_SHUFFLE, true); + args.putBoolean(Constants.INTENT_EXTRA_NAME_AUTOPLAY, true); + fragment.setArguments(args); + + replaceFragment(fragment); + break; case R.id.playlist_menu_delete: deletePlaylist(playlist); break; diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java index 0a822483..f01ee44b 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -279,7 +279,7 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR } } - MenuUtil.hideMenuItems(context, menu); + MenuUtil.hideMenuItems(context, menu, updateView); } protected void recreateContextMenu(Menu menu) { @@ -311,19 +311,33 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR case R.id.artist_menu_play_shuffled: downloadRecursively(artist.getId(), false, false, true, true, false); break; + case R.id.artist_menu_play_next: + downloadRecursively(artist.getId(), false, true, false, false, false, true); + break; case R.id.artist_menu_play_last: downloadRecursively(artist.getId(), false, true, false, false, false); break; case R.id.artist_menu_download: downloadRecursively(artist.getId(), false, true, false, false, true); break; - case R.id.artist_menu_star: - toggleStarred(artist); + case R.id.artist_menu_pin: + downloadRecursively(artist.getId(), true, true, false, false, true); + break; + case R.id.artist_menu_delete: + deleteRecursively(artist); break; case R.id.album_menu_play_now: artistOverride = true; downloadRecursively(entry.getId(), false, false, true, false, false); break; + case R.id.album_menu_play_shuffled: + artistOverride = true; + downloadRecursively(entry.getId(), false, false, true, true, false); + break; + case R.id.album_menu_play_next: + artistOverride = true; + downloadRecursively(entry.getId(), false, true, false, false, false, true); + break; case R.id.album_menu_play_last: artistOverride = true; downloadRecursively(entry.getId(), false, true, false, false, false); @@ -332,9 +346,16 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR artistOverride = true; downloadRecursively(entry.getId(), false, true, false, false, true); break; + case R.id.album_menu_pin: + artistOverride = true; + downloadRecursively(entry.getId(), true, true, false, false, true); + break; case R.id.album_menu_star: toggleStarred(entry); break; + case R.id.album_menu_delete: + deleteRecursively(entry); + break; case R.id.album_menu_info: displaySongInfo(entry); break; @@ -353,8 +374,11 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR case R.id.song_menu_download: getDownloadService().downloadBackground(songs, false); break; + case R.id.song_menu_pin: + getDownloadService().downloadBackground(songs, true); + break; case R.id.song_menu_delete: - getDownloadService().delete(songs); + deleteSongs(songs); break; case R.id.song_menu_add_playlist: addToPlaylist(songs); @@ -1419,15 +1443,14 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR } public void deleteRecursively(Artist artist) { - deleteRecursively(FileUtil.getArtistDirectory(context, artist)); + deleteRecursively(artist, FileUtil.getArtistDirectory(context, artist)); } public void deleteRecursively(Entry album) { - deleteRecursively(FileUtil.getAlbumDirectory(context, album)); - + deleteRecursively(album, FileUtil.getAlbumDirectory(context, album)); } - public void deleteRecursively(final File dir) { + public void deleteRecursively(final Object remove, final File dir) { if(dir == null) { return; } @@ -1443,7 +1466,37 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR @Override protected void done(Void result) { if(Util.isOffline(context)) { - refresh(); + SectionAdapter adapter = getCurrentAdapter(); + if(adapter != null) { + adapter.removeItem(remove); + } else { + refresh(); + } + } else { + UpdateView.triggerUpdate(); + } + } + }.execute(); + } + public void deleteSongs(final List<Entry> songs) { + new LoadingTask<Void>(context) { + @Override + protected Void doInBackground() throws Throwable { + getDownloadService().delete(songs); + return null; + } + + @Override + protected void done(Void result) { + if(Util.isOffline(context)) { + SectionAdapter adapter = getCurrentAdapter(); + if(adapter != null) { + for(Entry song: songs) { + adapter.removeItem(song); + } + } else { + refresh(); + } } else { UpdateView.triggerUpdate(); } diff --git a/app/src/main/java/github/daneren2005/dsub/util/Constants.java b/app/src/main/java/github/daneren2005/dsub/util/Constants.java index cc02b709..22463d9d 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/Constants.java +++ b/app/src/main/java/github/daneren2005/dsub/util/Constants.java @@ -133,8 +133,13 @@ public final class Constants { public static final String PREFERENCES_KEY_PODCASTS_ENABLED = "podcastsEnabled"; public static final String PREFERENCES_KEY_BOOKMARKS_ENABLED = "bookmarksEnabled"; public static final String PREFERENCES_KEY_CUSTOM_SORT_ENABLED = "customSortEnabled"; + public static final String PREFERENCES_KEY_MENU_PLAY_NOW = "showPlayNow"; + public static final String PREFERENCES_KEY_MENU_PLAY_SHUFFLED = "showPlayShuffled"; public static final String PREFERENCES_KEY_MENU_PLAY_NEXT = "showPlayNext"; public static final String PREFERENCES_KEY_MENU_PLAY_LAST = "showPlayLast"; + public static final String PREFERENCES_KEY_MENU_DOWNLOAD = "showDownload"; + public static final String PREFERENCES_KEY_MENU_PIN = "showPin"; + public static final String PREFERENCES_KEY_MENU_DELETE = "showDelete"; public static final String PREFERENCES_KEY_MENU_STAR = "showStar"; public static final String PREFERENCES_KEY_MENU_SHARED = "showShared"; public static final String PREFERENCES_KEY_SHARED_ENABLED = "sharedEnabled"; diff --git a/app/src/main/java/github/daneren2005/dsub/util/MenuUtil.java b/app/src/main/java/github/daneren2005/dsub/util/MenuUtil.java index cd899bb4..1b613b9d 100644 --- a/app/src/main/java/github/daneren2005/dsub/util/MenuUtil.java +++ b/app/src/main/java/github/daneren2005/dsub/util/MenuUtil.java @@ -17,13 +17,24 @@ package github.daneren2005.dsub.util; import android.content.Context; import android.content.SharedPreferences; +import android.util.Log; import android.view.Menu; +import java.io.File; + import github.daneren2005.dsub.R; import github.daneren2005.dsub.domain.ServerInfo; +import github.daneren2005.dsub.service.DownloadFile; +import github.daneren2005.dsub.view.AlbumView; +import github.daneren2005.dsub.view.ArtistEntryView; +import github.daneren2005.dsub.view.ArtistView; +import github.daneren2005.dsub.view.SongView; +import github.daneren2005.dsub.view.UpdateView; public final class MenuUtil { - public static void hideMenuItems(Context context, Menu menu) { + private final static String TAG = MenuUtil.class.getSimpleName(); + + public static void hideMenuItems(Context context, Menu menu, UpdateView updateView) { if(!ServerInfo.checkServerVersion(context, "1.8")) { menu.setGroupVisible(R.id.server_1_8, false); menu.setGroupVisible(R.id.hide_star, false); @@ -36,12 +47,27 @@ public final class MenuUtil { } SharedPreferences prefs = Util.getPreferences(context); - if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_NEXT, true)) { + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_NOW, true)) { + menu.setGroupVisible(R.id.hide_play_now, false); + } + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_SHUFFLED, true)) { + menu.setGroupVisible(R.id.hide_play_shuffled, false); + } + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_NEXT, false)) { menu.setGroupVisible(R.id.hide_play_next, false); } if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_LAST, true)) { menu.setGroupVisible(R.id.hide_play_last, false); } + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_DOWNLOAD, false)) { + menu.setGroupVisible(R.id.hide_download, false); + } + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PIN, false)) { + menu.setGroupVisible(R.id.hide_pin, false); + } + if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_DELETE, false)) { + menu.setGroupVisible(R.id.hide_delete, false); + } if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_STAR, true)) { menu.setGroupVisible(R.id.hide_star, false); } @@ -51,5 +77,51 @@ public final class MenuUtil { if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_RATING, true)) { menu.setGroupVisible(R.id.hide_rating, false); } + + if(!Util.isOffline(context)) { + // If we are looking at a standard song view, get downloadFile to cache what options to show + if(updateView instanceof SongView) { + SongView songView = (SongView) updateView; + DownloadFile downloadFile = songView.getDownloadFile(); + + try { + if(downloadFile != null) { + if(downloadFile.isWorkDone()) { + // Remove permanent cache menu if already perma cached + if(downloadFile.isSaved()) { + menu.setGroupVisible(R.id.hide_pin, false); + } + + // Remove cache option no matter what if already downloaded + menu.setGroupVisible(R.id.hide_download, false); + } else { + // Remove delete option if nothing to delete + menu.setGroupVisible(R.id.hide_delete, false); + } + } + } catch(Exception e) { + Log.w(TAG, "Failed to lookup downloadFile info", e); + } + } + // Apply similar logic to album views + else if(updateView instanceof AlbumView || updateView instanceof ArtistView || updateView instanceof ArtistEntryView) { + File folder = null; + if(updateView instanceof AlbumView) { + folder = ((AlbumView) updateView).getFile(); + } else if(updateView instanceof ArtistView) { + folder = ((ArtistView) updateView).getFile(); + } else if(updateView instanceof ArtistEntryView) { + folder = ((ArtistEntryView) updateView).getFile(); + } + + try { + if(folder != null && !folder.exists()) { + menu.setGroupVisible(R.id.hide_delete, false); + } + } catch(Exception e) { + Log.w(TAG, "Failed to lookup album directory info", e); + } + } + } } } diff --git a/app/src/main/res/menu/nowplaying_context.xml b/app/src/main/res/menu/nowplaying_context.xml index 845a98c8..60d6288e 100644 --- a/app/src/main/res/menu/nowplaying_context.xml +++ b/app/src/main/res/menu/nowplaying_context.xml @@ -18,9 +18,11 @@ android:id="@+id/menu_lyrics" android:title="@string/download.menu_lyrics"/> - <item - android:id="@+id/menu_delete" - android:title="@string/menu.delete_cache"/> + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> <group android:id="@+id/hide_star"> <item diff --git a/app/src/main/res/menu/nowplaying_context_offline.xml b/app/src/main/res/menu/nowplaying_context_offline.xml index 9ce63d79..5f8009ff 100644 --- a/app/src/main/res/menu/nowplaying_context_offline.xml +++ b/app/src/main/res/menu/nowplaying_context_offline.xml @@ -14,9 +14,11 @@ android:id="@+id/menu_show_album" android:title="@string/download.menu_show_album"/> - <item - android:id="@+id/menu_delete" - android:title="@string/menu.delete_cache"/> + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> <group android:id="@+id/hide_star"> <item diff --git a/app/src/main/res/menu/select_album_context.xml b/app/src/main/res/menu/select_album_context.xml index b06f2d24..e4a901ac 100644 --- a/app/src/main/res/menu/select_album_context.xml +++ b/app/src/main/res/menu/select_album_context.xml @@ -5,9 +5,23 @@ android:id="@+id/album_menu_info" android:title="@string/common.info"/> - <item - android:id="@+id/album_menu_play_now" - android:title="@string/common.play_now"/> + <group android:id="@+id/hide_play_now"> + <item + android:id="@+id/album_menu_play_now" + android:title="@string/common.play_now"/> + </group> + + <group android:id="@+id/hide_play_shuffled"> + <item + android:id="@+id/album_menu_play_shuffled" + android:title="@string/common.play_shuffled"/> + </group> + + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/album_menu_play_next" + android:title="@string/common.play_next"/> + </group> <group android:id="@+id/hide_play_last"> <item @@ -15,9 +29,23 @@ android:title="@string/common.play_last"/> </group> - <item - android:id="@+id/album_menu_download" - android:title="@string/common.download"/> + <group android:id="@+id/hide_download"> + <item + android:id="@+id/album_menu_download" + android:title="@string/common.download"/> + </group> + + <group android:id="@+id/hide_pin"> + <item + android:id="@+id/album_menu_pin" + android:title="@string/common.pin"/> + </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/album_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> <item android:id="@+id/album_menu_show_artist" diff --git a/app/src/main/res/menu/select_album_context_offline.xml b/app/src/main/res/menu/select_album_context_offline.xml index d65ff725..c10f2c62 100644 --- a/app/src/main/res/menu/select_album_context_offline.xml +++ b/app/src/main/res/menu/select_album_context_offline.xml @@ -5,17 +5,39 @@ android:id="@+id/album_menu_info" android:title="@string/common.info"/> - <item - android:id="@+id/album_menu_star" - android:title="@string/common.star"/> + <group android:id="@+id/hide_play_now"> + <item + android:id="@+id/album_menu_play_now" + android:title="@string/common.play_now"/> + </group> - <item - android:id="@+id/album_menu_play_now" - android:title="@string/common.play_now"/> + <group android:id="@+id/hide_play_shuffled"> + <item + android:id="@+id/album_menu_play_shuffled" + android:title="@string/common.play_shuffled"/> + </group> + + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/album_menu_play_next" + android:title="@string/common.play_next"/> + </group> <group android:id="@+id/hide_play_last"> <item android:id="@+id/album_menu_play_last" android:title="@string/common.play_last"/> </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/album_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> + + <group android:id="@+id/hide_star"> + <item + android:id="@+id/album_menu_star" + android:title="@string/common.star"/> + </group> </menu> diff --git a/app/src/main/res/menu/select_artist_context.xml b/app/src/main/res/menu/select_artist_context.xml index 8e87d932..589f044c 100644 --- a/app/src/main/res/menu/select_artist_context.xml +++ b/app/src/main/res/menu/select_artist_context.xml @@ -1,25 +1,48 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <group android:id="@+id/server_1_10"> + <group android:id="@+id/hide_play_now"> <item android:id="@+id/artist_menu_play_now" android:title="@string/common.play_now"/> + </group> + <group android:id="@+id/hide_play_shuffled"> <item android:id="@+id/artist_menu_play_shuffled" android:title="@string/common.play_shuffled"/> + </group> - <group android:id="@+id/hide_play_last"> - <item - android:id="@+id/artist_menu_play_last" - android:title="@string/common.play_last"/> - </group> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/artist_menu_play_next" + android:title="@string/common.play_next"/> + </group> + + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/artist_menu_play_last" + android:title="@string/common.play_last"/> + </group> + <group android:id="@+id/hide_download"> <item android:id="@+id/artist_menu_download" - android:title="@string/common.download" - /> + android:title="@string/common.download"/> + </group> + + <group android:id="@+id/hide_pin"> + <item + android:id="@+id/artist_menu_pin" + android:title="@string/common.pin"/> + </group> + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/artist_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> + + <group android:id="@+id/server_1_10"> <group android:id="@+id/hide_star"> <item android:id="@+id/artist_menu_star" diff --git a/app/src/main/res/menu/select_artist_context_offline.xml b/app/src/main/res/menu/select_artist_context_offline.xml index 0fb9aad7..a14d6dc8 100644 --- a/app/src/main/res/menu/select_artist_context_offline.xml +++ b/app/src/main/res/menu/select_artist_context_offline.xml @@ -1,21 +1,32 @@ <?xml version="1.0" encoding="utf-8"?> <menu xmlns:android="http://schemas.android.com/apk/res/android"> - <item - android:id="@+id/artist_menu_play_now" - android:title="@string/common.play_now"/> + <group android:id="@+id/hide_play_now"> + <item + android:id="@+id/artist_menu_play_now" + android:title="@string/common.play_now"/> + </group> - <item - android:id="@+id/artist_menu_play_shuffled" - android:title="@string/common.play_shuffled"/> + <group android:id="@+id/hide_play_shuffled"> + <item + android:id="@+id/artist_menu_play_shuffled" + android:title="@string/common.play_shuffled"/> + </group> - <item - android:id="@+id/artist_menu_download" - android:title="@string/common.download" - /> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/artist_menu_play_next" + android:title="@string/common.play_next"/> + </group> <group android:id="@+id/hide_play_last"> <item android:id="@+id/artist_menu_play_last" android:title="@string/common.play_last"/> </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/artist_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> </menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/select_bookmark_context.xml b/app/src/main/res/menu/select_bookmark_context.xml index 20808cf5..468bc2fb 100644 --- a/app/src/main/res/menu/select_bookmark_context.xml +++ b/app/src/main/res/menu/select_bookmark_context.xml @@ -25,6 +25,24 @@ <item android:id="@+id/song_menu_show_artist" android:title="@string/menu.show_artist"/> + + <group android:id="@+id/hide_download"> + <item + android:id="@+id/song_menu_download" + android:title="@string/common.download"/> + </group> + + <group android:id="@+id/hide_pin"> + <item + android:id="@+id/song_menu_pin" + android:title="@string/common.pin"/> + </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> <item android:id="@+id/bookmark_menu_delete" diff --git a/app/src/main/res/menu/select_playlist_context.xml b/app/src/main/res/menu/select_playlist_context.xml index 4941e94b..ff3618a9 100644 --- a/app/src/main/res/menu/select_playlist_context.xml +++ b/app/src/main/res/menu/select_playlist_context.xml @@ -4,8 +4,25 @@ <item android:id="@+id/playlist_info" - android:title="@string/common.info" - /> + android:title="@string/common.info"/> + + <group android:id="@+id/hide_play_now"> + <item + android:id="@+id/playlist_menu_play_now" + android:title="@string/common.play_now"/> + </group> + + <group android:id="@+id/hide_play_shuffled"> + <item + android:id="@+id/playlist_menu_play_shuffled" + android:title="@string/common.play_shuffled"/> + </group> + + <group android:id="@+id/hide_download"> + <item + android:id="@+id/playlist_menu_download" + android:title="@string/common.download"/> + </group> <item android:id="@+id/playlist_menu_sync" @@ -17,12 +34,10 @@ <item android:id="@+id/playlist_update_info" - android:title="@string/playlist.update_info" - /> + android:title="@string/playlist.update_info"/> <item android:id="@+id/playlist_menu_delete" - android:title="@string/playlist.delete" - /> + android:title="@string/playlist.delete"/> </menu> diff --git a/app/src/main/res/menu/select_playlist_context_offline.xml b/app/src/main/res/menu/select_playlist_context_offline.xml index 6745d850..6cbc1e11 100644 --- a/app/src/main/res/menu/select_playlist_context_offline.xml +++ b/app/src/main/res/menu/select_playlist_context_offline.xml @@ -2,6 +2,17 @@ <menu xmlns:android="http://schemas.android.com/apk/res/android"> <item android:id="@+id/playlist_info" - android:title="@string/common.info" - /> + android:title="@string/common.info"/> + + <group android:id="@+id/hide_play_now"> + <item + android:id="@+id/playlist_menu_play_now" + android:title="@string/common.play_now"/> + </group> + + <group android:id="@+id/hide_play_shuffled"> + <item + android:id="@+id/playlist_menu_play_shuffled" + android:title="@string/common.play_shuffled"/> + </group> </menu>
\ No newline at end of file diff --git a/app/src/main/res/menu/select_podcast_episode_context.xml b/app/src/main/res/menu/select_podcast_episode_context.xml index 057ff187..a05e58be 100644 --- a/app/src/main/res/menu/select_podcast_episode_context.xml +++ b/app/src/main/res/menu/select_podcast_episode_context.xml @@ -18,12 +18,24 @@ android:title="@string/common.play_last"/> </group> + <group android:id="@+id/hide_download"> + <item + android:id="@+id/song_menu_download" + android:title="@string/common.download"/> + </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> + <group android:id="@+id/server_1.9"> <item android:id="@+id/bookmark_menu_delete" android:title="@string/bookmark.delete"/> </group> - + <item android:id="@+id/song_menu_server_download" android:title="@string/select_podcasts.server_download"/> diff --git a/app/src/main/res/menu/select_song.xml b/app/src/main/res/menu/select_song.xml index 5718866a..5277f881 100644 --- a/app/src/main/res/menu/select_song.xml +++ b/app/src/main/res/menu/select_song.xml @@ -33,15 +33,11 @@ android:id="@+id/menu_delete" android:title="@string/menu.delete_cache"/> - <group android:id="@+id/hide_play_next"> - <item - android:id="@+id/menu_play_next" - android:title="@string/common.play_next"/> - </group> + <item + android:id="@+id/menu_play_next" + android:title="@string/common.play_next"/> - <group android:id="@+id/hide_play_last"> - <item - android:id="@+id/menu_play_last" - android:title="@string/menu.play_last"/> - </group> + <item + android:id="@+id/menu_play_last" + android:title="@string/menu.play_last"/> </menu> diff --git a/app/src/main/res/menu/select_song_context.xml b/app/src/main/res/menu/select_song_context.xml index ef5478b6..34ea27a6 100644 --- a/app/src/main/res/menu/select_song_context.xml +++ b/app/src/main/res/menu/select_song_context.xml @@ -18,6 +18,24 @@ android:id="@+id/song_menu_play_last" android:title="@string/common.play_last"/> </group> + + <group android:id="@+id/hide_download"> + <item + android:id="@+id/song_menu_download" + android:title="@string/common.download"/> + </group> + + <group android:id="@+id/hide_pin"> + <item + android:id="@+id/song_menu_pin" + android:title="@string/common.pin"/> + </group> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> <group android:id="@+id/server_1.8"> <item diff --git a/app/src/main/res/menu/select_song_context_offline.xml b/app/src/main/res/menu/select_song_context_offline.xml index da0f366e..1c52e792 100644 --- a/app/src/main/res/menu/select_song_context_offline.xml +++ b/app/src/main/res/menu/select_song_context_offline.xml @@ -18,7 +18,15 @@ android:title="@string/common.play_last"/> </group> - <item - android:id="@+id/song_menu_star" - android:title="@string/common.star"/> + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> + + <group android:id="@+id/hide_star"> + <item + android:id="@+id/song_menu_star" + android:title="@string/common.star"/> + </group> </menu> diff --git a/app/src/main/res/menu/select_song_offline.xml b/app/src/main/res/menu/select_song_offline.xml index 7a4a5407..383e1be3 100644 --- a/app/src/main/res/menu/select_song_offline.xml +++ b/app/src/main/res/menu/select_song_offline.xml @@ -17,15 +17,11 @@ android:id="@+id/menu_delete" android:title="@string/menu.delete_cache"/> - <group android:id="@+id/hide_play_next"> - <item - android:id="@+id/menu_play_next" - android:title="@string/common.play_next"/> - </group> + <item + android:id="@+id/menu_play_next" + android:title="@string/common.play_next"/> - <group android:id="@+id/hide_play_last"> - <item - android:id="@+id/menu_play_last" - android:title="@string/menu.play_last"/> - </group> + <item + android:id="@+id/menu_play_last" + android:title="@string/menu.play_last"/> </menu> diff --git a/app/src/main/res/menu/select_video_context.xml b/app/src/main/res/menu/select_video_context.xml index 3eda2df7..41d2b1a6 100644 --- a/app/src/main/res/menu/select_video_context.xml +++ b/app/src/main/res/menu/select_video_context.xml @@ -13,12 +13,15 @@ android:id="@+id/song_menu_play_external" android:title="@string/common.play_external"/> - <item - android:id="@+id/song_menu_download" - android:title="@string/common.download" - /> + <group android:id="@+id/hide_download"> + <item + android:id="@+id/song_menu_download" + android:title="@string/common.download"/> + </group> - <item - android:id="@+id/song_menu_delete" - android:title="@string/menu.delete_cache"/> + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> </menu> diff --git a/app/src/main/res/menu/select_video_context_offline.xml b/app/src/main/res/menu/select_video_context_offline.xml index 3fea9f5e..fdf8f288 100644 --- a/app/src/main/res/menu/select_video_context_offline.xml +++ b/app/src/main/res/menu/select_video_context_offline.xml @@ -8,8 +8,10 @@ <item android:id="@+id/song_menu_play_external" android:title="@string/common.play_external"/> - - <item - android:id="@+id/song_menu_delete" - android:title="@string/menu.delete_cache"/> + + <group android:id="@+id/hide_delete"> + <item + android:id="@+id/song_menu_delete" + android:title="@string/menu.delete_cache"/> + </group> </menu> diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index d87dbf69..972fb5d4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -424,8 +424,13 @@ <string name="settings.sync_notification">Show Sync Notification</string> <string name="settings.sync_notification_summary">Show a notification after new media has been synced</string> <string name="settings.menu_options.title">Optional Menu Options</string> - <string name="settings.menu_options.play_next_summary">Show Play next in menus</string> - <string name="settings.menu_options.play_last_summary">Show Play last in menus</string> + <string name="settings.menu_options.play_now_summary">Show Now in menus</string> + <string name="settings.menu_options.play_shuffled_summary">Show Shuffled in menus</string> + <string name="settings.menu_options.play_next_summary">Show Play Next in menus</string> + <string name="settings.menu_options.play_last_summary">Show Play Last in menus</string> + <string name="settings.menu_options.download_summary">Show Download in menus</string> + <string name="settings.menu_options.pin_summary">Show Permanent Cache in menus</string> + <string name="settings.menu_options.delete_summary">Show Delete in menus</string> <string name="settings.menu_options.star_summary">Show Star in menus</string> <string name="settings.menu_options.shared_summary">Show Share in menus</string> <string name="settings.menu_options.rate_summary">Show Rating in menus</string> diff --git a/app/src/main/res/xml/settings.xml b/app/src/main/res/xml/settings.xml index dec8d928..084811a1 100644 --- a/app/src/main/res/xml/settings.xml +++ b/app/src/main/res/xml/settings.xml @@ -99,10 +99,22 @@ android:title="@string/settings.menu_options.title"> <CheckBoxPreference + android:title="@string/common.play_now" + android:summary="@string/settings.menu_options.play_now_summary" + android:key="showPlayNow" + android:defaultValue="true"/> + + <CheckBoxPreference + android:title="@string/common.play_shuffled" + android:summary="@string/settings.menu_options.play_shuffled_summary" + android:key="showPlayShuffled" + android:defaultValue="true"/> + + <CheckBoxPreference android:title="@string/common.play_next" android:summary="@string/settings.menu_options.play_next_summary" android:key="showPlayNext" - android:defaultValue="true"/> + android:defaultValue="false"/> <CheckBoxPreference android:title="@string/common.play_last" @@ -111,6 +123,24 @@ android:defaultValue="true"/> <CheckBoxPreference + android:title="@string/common.download" + android:summary="@string/settings.menu_options.download_summary" + android:key="showDownload" + android:defaultValue="false"/> + + <CheckBoxPreference + android:title="@string/common.pin" + android:summary="@string/settings.menu_options.pin_summary" + android:key="showPin" + android:defaultValue="false"/> + + <CheckBoxPreference + android:title="@string/common.delete" + android:summary="@string/settings.menu_options.delete_summary" + android:key="showDelete" + android:defaultValue="false"/> + + <CheckBoxPreference android:title="@string/common.star" android:summary="@string/settings.menu_options.star_summary" android:key="showStar" @@ -127,7 +157,6 @@ android:summary="@string/settings.menu_options.rate_summary" android:key="showRating" android:defaultValue="true"/> - </PreferenceCategory> </PreferenceScreen> |