[Android] Audio GUI: put back the play function in the context menu for the artist and genre panels because it allows to play all their media
Adrien Maglo
git at videolan.org
Fri Mar 21 18:02:05 CET 2014
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Mar 21 17:47:14 2014 +0100| [79dacbf6a718d684f840e0ab4fde86e56017026a] | committer: Adrien Maglo
Audio GUI: put back the play function in the context menu for the artist and genre panels because it allows to play all their media
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=79dacbf6a718d684f840e0ab4fde86e56017026a
---
vlc-android/res/menu/audio_list_browser.xml | 4 ++++
.../src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java | 7 ++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/vlc-android/res/menu/audio_list_browser.xml b/vlc-android/res/menu/audio_list_browser.xml
index 1f6736d..6bda46a 100644
--- a/vlc-android/res/menu/audio_list_browser.xml
+++ b/vlc-android/res/menu/audio_list_browser.xml
@@ -1,6 +1,10 @@
<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item
+ android:id="@+id/audio_list_browser_play"
+ android:title="@string/play"
+ android:visible="false" />
+ <item
android:id="@+id/audio_list_browser_append"
android:title="@string/append" />
<group android:id="@+id/songs_view_only">
diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
index 649aade..0ea50ed 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserFragment.java
@@ -214,10 +214,15 @@ public class AudioBrowserFragment extends SherlockFragment {
}
private void setContextMenuItems(Menu menu, View v) {
- if (v.getId() != R.id.songs_list) {
+ final int pos = mFlingViewGroup.getPosition();
+ if (pos != MODE_SONG) {
menu.setGroupVisible(R.id.songs_view_only, false);
menu.setGroupVisible(R.id.phone_only, false);
}
+ if (pos == MODE_ARTIST || v.getId() == MODE_GENRE) {
+ MenuItem play = menu.findItem(R.id.audio_list_browser_play);
+ play.setVisible(true);
+ }
if (!Util.isPhone())
menu.setGroupVisible(R.id.phone_only, false);
}
More information about the Android
mailing list