aboutsummaryrefslogtreecommitdiff
path: root/app/src/main
diff options
context:
space:
mode:
authorScott Jackson <daneren2005@gmail.com>2016-09-19 17:30:38 -0700
committerScott Jackson <daneren2005@gmail.com>2016-09-19 17:30:38 -0700
commita1b4150eafd6358d4b2724693fc4b4a847c4b37a (patch)
treecbff5f50395a28b2e52596bc920d5f7944997c44 /app/src/main
parent5f0853a56d5214ab1c9d4238c500c8433d64e28e (diff)
downloaddsub-a1b4150eafd6358d4b2724693fc4b4a847c4b37a.tar.gz
dsub-a1b4150eafd6358d4b2724693fc4b4a847c4b37a.tar.bz2
dsub-a1b4150eafd6358d4b2724693fc4b4a847c4b37a.zip
Fixes #735: Add Play Now to song's context menu when click to add
Diffstat (limited to 'app/src/main')
-rw-r--r--app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java9
-rw-r--r--app/src/main/res/menu/select_song_context.xml6
-rw-r--r--app/src/main/res/menu/select_song_context_offline.xml9
3 files changed, 22 insertions, 2 deletions
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 b7478c8a..818324ed 100644
--- a/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java
+++ b/app/src/main/java/github/daneren2005/dsub/fragments/SubsonicFragment.java
@@ -309,6 +309,12 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
if(entry.getBookmark() == null) {
menu.removeItem(R.id.bookmark_menu_delete);
}
+
+
+ String songPressAction = Util.getSongPressAction(context);
+ if(!"next".equals(songPressAction) && !"last".equals(songPressAction)) {
+ menu.setGroupVisible(R.id.hide_play_now, false);
+ }
}
} else {
if(Util.isOffline(context)) {
@@ -430,6 +436,9 @@ public class SubsonicFragment extends Fragment implements SwipeRefreshLayout.OnR
case R.id.album_menu_share:
createShare(songs);
break;
+ case R.id.song_menu_play_now:
+ playNow(songs);
+ break;
case R.id.song_menu_play_next:
getDownloadService().download(songs, false, false, true, false);
break;
diff --git a/app/src/main/res/menu/select_song_context.xml b/app/src/main/res/menu/select_song_context.xml
index b68dcad9..46eaaa38 100644
--- a/app/src/main/res/menu/select_song_context.xml
+++ b/app/src/main/res/menu/select_song_context.xml
@@ -15,6 +15,12 @@
android:title="@string/menu.show_artist"/>
</group>
+ <group android:id="@+id/hide_play_now">
+ <item
+ android:id="@+id/song_menu_play_now"
+ android:title="@string/common.play_now"/>
+ </group>
+
<group android:id="@+id/hide_play_next">
<item
android:id="@+id/song_menu_play_next"
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 d7182068..cc914563 100644
--- a/app/src/main/res/menu/select_song_context_offline.xml
+++ b/app/src/main/res/menu/select_song_context_offline.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<menu xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:compat="http://schemas.android.com/apk/res-auto">
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
android:id="@+id/song_menu_info"
@@ -16,6 +15,12 @@
android:title="@string/menu.show_artist"/>
</group>
+ <group android:id="@+id/hide_play_now">
+ <item
+ android:id="@+id/song_menu_play_now"
+ android:title="@string/common.play_now"/>
+ </group>
+
<group android:id="@+id/hide_play_next">
<item
android:id="@+id/song_menu_play_next"