diff options
-rw-r--r-- | res/menu/nowplaying_context.xml | 10 | ||||
-rw-r--r-- | res/menu/select_album_context.xml | 28 | ||||
-rw-r--r-- | res/menu/select_album_context_offline.xml | 17 | ||||
-rw-r--r-- | res/menu/select_artist_context.xml | 25 | ||||
-rw-r--r-- | res/menu/select_artist_context_offline.xml | 17 | ||||
-rw-r--r-- | res/menu/select_podcast_episode_context.xml | 15 | ||||
-rw-r--r-- | res/menu/select_podcast_episode_context_offline.xml | 15 | ||||
-rw-r--r-- | res/menu/select_song.xml | 18 | ||||
-rw-r--r-- | res/menu/select_song_context.xml | 29 | ||||
-rw-r--r-- | res/menu/select_song_context_offline.xml | 18 | ||||
-rw-r--r-- | res/menu/select_song_offline.xml | 18 | ||||
-rw-r--r-- | res/values/strings.xml | 7 | ||||
-rw-r--r-- | res/xml/settings.xml | 23 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java | 9 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/fragments/SubsonicFragment.java | 15 | ||||
-rw-r--r-- | src/github/daneren2005/dsub/util/Constants.java | 3 |
16 files changed, 183 insertions, 84 deletions
diff --git a/res/menu/nowplaying_context.xml b/res/menu/nowplaying_context.xml index 405b8e51..57e5bde5 100644 --- a/res/menu/nowplaying_context.xml +++ b/res/menu/nowplaying_context.xml @@ -21,10 +21,12 @@ <item android:id="@+id/menu_delete" android:title="@string/download.menu_delete"/> - - <item - android:id="@+id/menu_star" - android:title="@string/common.star"/> + + <group android:id="@+id/hide_star"> + <item + android:id="@+id/menu_star" + android:title="@string/common.star"/> + </group> <item android:id="@+id/menu_add_playlist" diff --git a/res/menu/select_album_context.xml b/res/menu/select_album_context.xml index 0679cd54..6da0150b 100644 --- a/res/menu/select_album_context.xml +++ b/res/menu/select_album_context.xml @@ -17,14 +17,17 @@ android:title="@string/common.play_shuffled" /> - <item - android:id="@+id/album_menu_play_next" - android:title="@string/common.play_next"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/album_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/album_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/album_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/album_menu_download" @@ -43,9 +46,10 @@ <item android:id="@+id/album_menu_show_artist" android:title="@string/menu.show_artist"/> - - <item - android:id="@+id/album_menu_star" - android:title="@string/common.star"/> - + + <group android:id="@+id/hide_star"> + <item + android:id="@+id/album_menu_star" + android:title="@string/common.star"/> + </group> </menu> diff --git a/res/menu/select_album_context_offline.xml b/res/menu/select_album_context_offline.xml index c0fa32de..9eb5995f 100644 --- a/res/menu/select_album_context_offline.xml +++ b/res/menu/select_album_context_offline.xml @@ -11,14 +11,17 @@ android:title="@string/common.play_shuffled" /> - <item - android:id="@+id/album_menu_play_next" - android:title="@string/common.play_next"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/album_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/album_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/album_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/album_menu_delete" diff --git a/res/menu/select_artist_context.xml b/res/menu/select_artist_context.xml index e2a401a0..2a71cec9 100644 --- a/res/menu/select_artist_context.xml +++ b/res/menu/select_artist_context.xml @@ -12,14 +12,17 @@ android:title="@string/common.play_shuffled" /> - <item - android:id="@+id/artist_menu_play_next" - android:title="@string/common.play_next"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/artist_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/artist_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/artist_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/artist_menu_download" @@ -36,8 +39,10 @@ android:title="@string/common.delete"/> <group android:id="@+id/server_1_10"> - <item - android:id="@+id/artist_menu_star" - android:title="@string/common.star"/> + <group android:id="@+id/hide_star"> + <item + android:id="@+id/artist_menu_star" + android:title="@string/common.star"/> + </group> </group> </menu> diff --git a/res/menu/select_artist_context_offline.xml b/res/menu/select_artist_context_offline.xml index b48471be..bfd7685a 100644 --- a/res/menu/select_artist_context_offline.xml +++ b/res/menu/select_artist_context_offline.xml @@ -12,14 +12,17 @@ android:title="@string/common.play_shuffled" /> - <item - android:id="@+id/artist_menu_play_next" - android:title="@string/common.play_next"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/artist_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/artist_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/artist_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/artist_menu_delete" diff --git a/res/menu/select_podcast_episode_context.xml b/res/menu/select_podcast_episode_context.xml index deffdecf..79eaa04d 100644 --- a/res/menu/select_podcast_episode_context.xml +++ b/res/menu/select_podcast_episode_context.xml @@ -12,10 +12,17 @@ android:title="@string/common.play_now" /> - <item - android:id="@+id/song_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/song_menu_play_next" + android:title="@string/common.play_next"/> + </group> + + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/song_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/song_menu_download" diff --git a/res/menu/select_podcast_episode_context_offline.xml b/res/menu/select_podcast_episode_context_offline.xml index 8d1508ac..a7dc1619 100644 --- a/res/menu/select_podcast_episode_context_offline.xml +++ b/res/menu/select_podcast_episode_context_offline.xml @@ -12,10 +12,17 @@ android:title="@string/common.play_now" /> - <item - android:id="@+id/song_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/song_menu_play_next" + android:title="@string/common.play_next"/> + </group> + + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/song_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/song_menu_delete" diff --git a/res/menu/select_song.xml b/res/menu/select_song.xml index c2c0b437..38bebb39 100644 --- a/res/menu/select_song.xml +++ b/res/menu/select_song.xml @@ -43,11 +43,15 @@ android:id="@+id/menu_remove_playlist" android:title="@string/menu.remove_playlist"/> - <item - android:id="@+id/menu_play_next" - android:title="@string/common.play_next"/> - - <item - android:id="@+id/menu_play_last" - android:title="@string/menu.play_last"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/menu_play_next" + android:title="@string/common.play_next"/> + </group> + + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/menu_play_last" + android:title="@string/menu.play_last"/> + </group> </menu> diff --git a/res/menu/select_song_context.xml b/res/menu/select_song_context.xml index e2048b20..686ef308 100644 --- a/res/menu/select_song_context.xml +++ b/res/menu/select_song_context.xml @@ -12,15 +12,17 @@ android:title="@string/common.play_now" /> - <item - android:id="@+id/song_menu_play_next" - android:title="@string/common.play_next" - /> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/song_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/song_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/song_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/song_menu_download" @@ -43,9 +45,10 @@ <item android:id="@+id/song_menu_remove_playlist" android:title="@string/menu.remove_playlist"/> - - <item - android:id="@+id/song_menu_star" - android:title="@string/common.star"/> - + + <group android:id="@+id/hide_star"> + <item + android:id="@+id/song_menu_star" + android:title="@string/common.star"/> + </group> </menu> diff --git a/res/menu/select_song_context_offline.xml b/res/menu/select_song_context_offline.xml index 36a0c1ff..401a9b69 100644 --- a/res/menu/select_song_context_offline.xml +++ b/res/menu/select_song_context_offline.xml @@ -12,15 +12,17 @@ android:title="@string/common.play_now" /> - <item - android:id="@+id/song_menu_play_next" - android:title="@string/common.play_next" - /> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/song_menu_play_next" + android:title="@string/common.play_next"/> + </group> - <item - android:id="@+id/song_menu_play_last" - android:title="@string/common.play_last" - /> + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/song_menu_play_last" + android:title="@string/common.play_last"/> + </group> <item android:id="@+id/song_menu_delete" diff --git a/res/menu/select_song_offline.xml b/res/menu/select_song_offline.xml index c379714a..f0ca1cee 100644 --- a/res/menu/select_song_offline.xml +++ b/res/menu/select_song_offline.xml @@ -27,11 +27,15 @@ android:id="@+id/menu_delete" android:title="@string/common.delete"/> - <item - android:id="@+id/menu_play_next" - android:title="@string/common.play_next"/> - - <item - android:id="@+id/menu_play_last" - android:title="@string/menu.play_last"/> + <group android:id="@+id/hide_play_next"> + <item + android:id="@+id/menu_play_next" + android:title="@string/common.play_next"/> + </group> + + <group android:id="@+id/hide_play_last"> + <item + android:id="@+id/menu_play_last" + android:title="@string/menu.play_last"/> + </group> </menu> diff --git a/res/values/strings.xml b/res/values/strings.xml index f3c14b82..4603c8b3 100644 --- a/res/values/strings.xml +++ b/res/values/strings.xml @@ -374,6 +374,13 @@ <string name="settings.sync_starred_summary">Automatically cache songs, albums, and artists which are starred</string>
<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">Play Next</string>
+ <string name="settings.menu_options.play_next_summary">Show Play next in menus</string>
+ <string name="settings.menu_options.play_last">Play Last</string>
+ <string name="settings.menu_options.play_last_summary">Show Play last in menus</string>
+ <string name="settings.menu_options.star">Star</string>
+ <string name="settings.menu_options.star_summary">Show Star in menus</string>
<string name="shuffle.title">Shuffle By</string>
<string name="shuffle.startYear">Start Year:</string>
diff --git a/res/xml/settings.xml b/res/xml/settings.xml index 7234d246..58549367 100644 --- a/res/xml/settings.xml +++ b/res/xml/settings.xml @@ -58,6 +58,29 @@ </PreferenceCategory> <PreferenceCategory + android:title="@string/settings.menu_options.title"> + + <CheckBoxPreference + android:title="@string/settings.menu_options.play_next" + android:summary="@string/settings.menu_options.play_next_summary" + android:key="showPlayNext" + android:defaultValue="true"/> + + <CheckBoxPreference + android:title="@string/settings.menu_options.play_last" + android:summary="@string/settings.menu_options.play_last_summary" + android:key="showPlayLast" + android:defaultValue="true"/> + + <CheckBoxPreference + android:title="@string/settings.menu_options.star" + android:summary="@string/settings.menu_options.star_summary" + android:key="showStar" + android:defaultValue="true"/> + + </PreferenceCategory> + + <PreferenceCategory android:title="@string/button_bar.chat"> <CheckBoxPreference diff --git a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java index 8077bf9f..acc659b2 100644 --- a/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java +++ b/src/github/daneren2005/dsub/fragments/SelectDirectoryFragment.java @@ -3,6 +3,7 @@ package github.daneren2005.dsub.fragments; import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
+import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
import android.util.Log;
@@ -180,6 +181,14 @@ public class SelectDirectoryFragment extends SubsonicFragment implements Adapter menu.removeItem(R.id.menu_remove_playlist);
}
}
+
+ SharedPreferences prefs = Util.getPreferences(context);
+ if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_NEXT, true)) {
+ 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);
+ }
} else {
if(Util.isOffline(context)) {
menuInflater.inflate(R.menu.select_podcast_episode_offline, menu);
diff --git a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java index 224c051b..c9040048 100644 --- a/src/github/daneren2005/dsub/fragments/SubsonicFragment.java +++ b/src/github/daneren2005/dsub/fragments/SubsonicFragment.java @@ -202,12 +202,25 @@ public class SubsonicFragment extends Fragment { if(!Util.checkServerVersion(context, "1.10.1")) {
menu.setGroupVisible(R.id.server_1_10, false);
}
+ SharedPreferences prefs = Util.getPreferences(context);
+ if(!prefs.getBoolean(Constants.PREFERENCES_KEY_MENU_PLAY_NEXT, true)) {
+ 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_STAR, true)) {
+ menu.setGroupVisible(R.id.hide_star, false);
+ }
}
protected void recreateContextMenu(ContextMenu menu) {
List<MenuItem> menuItems = new ArrayList<MenuItem>();
for(int i = 0; i < menu.size(); i++) {
- menuItems.add(menu.getItem(i));
+ MenuItem item = menu.getItem(i);
+ if(item.isVisible()) {
+ menuItems.add(item);
+ }
}
menu.clear();
for(int i = 0; i < menuItems.size(); i++) {
diff --git a/src/github/daneren2005/dsub/util/Constants.java b/src/github/daneren2005/dsub/util/Constants.java index c539b45a..b4acb2e5 100644 --- a/src/github/daneren2005/dsub/util/Constants.java +++ b/src/github/daneren2005/dsub/util/Constants.java @@ -130,6 +130,9 @@ 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_NEXT = "showPlayNext"; + public static final String PREFERENCES_KEY_MENU_PLAY_LAST = "showPlayLast"; + public static final String PREFERENCES_KEY_MENU_STAR = "showStar"; public static final String OFFLINE_SCROBBLE_COUNT = "scrobbleCount"; public static final String OFFLINE_SCROBBLE_ID = "scrobbleID"; |