[Android] Hide context menu button for playlists in dialogs

Geoffrey Métais git at videolan.org
Tue Nov 7 13:32:43 CET 2017


vlc-android | branch: 2.5.x | Geoffrey Métais <geoffrey.metais at gmail.com> | Tue Nov  7 13:12:32 2017 +0100| [b3abe52d57e17eaeaa9be3b27070c0e1c0c2b97d] | committer: Geoffrey Métais

Hide context menu button for playlists in dialogs

Close #407

(cherry picked from commit a6ded1d676ea56d04b773994755354992f1f76c3)

> https://code.videolan.org/videolan/vlc-android/commit/b3abe52d57e17eaeaa9be3b27070c0e1c0c2b97d
---

 .../src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java      | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
index 8fc8127c7..462a0f96d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserAdapter.java
@@ -57,6 +57,7 @@ import java.util.LinkedList;
 import java.util.List;
 
 import static org.videolan.medialibrary.media.MediaLibraryItem.FLAG_SELECTED;
+import static org.videolan.medialibrary.media.MediaLibraryItem.TYPE_PLAYLIST;
 
 public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, AudioBrowserAdapter.ViewHolder> implements FastScroller.SeparatedAdapter, Filterable {
 
@@ -96,10 +97,12 @@ public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, Audio
     public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
         LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
         if (viewType == MediaLibraryItem.TYPE_DUMMY) {
-            AudioBrowserSeparatorBinding binding = AudioBrowserSeparatorBinding.inflate(inflater, parent, false);
-            return new ViewHolder(binding);
+            final AudioBrowserSeparatorBinding binding = AudioBrowserSeparatorBinding.inflate(inflater, parent, false);
+            return new ViewHolder<>(binding);
         } else {
-            AudioBrowserItemBinding binding = AudioBrowserItemBinding.inflate(inflater, parent, false);
+            final AudioBrowserItemBinding binding = AudioBrowserItemBinding.inflate(inflater, parent, false);
+            if (mType == TYPE_PLAYLIST && !mMakeSections) // Hide context button for playlist in save playlist dialog
+                binding.itemMore.setVisibility(View.GONE);
             return new MediaItemViewHolder(binding);
         }
     }



More information about the Android mailing list