Commit a6ded1d6 authored by Geoffrey Métais's avatar Geoffrey Métais

Hide context menu button for playlists in dialogs

Close #407
parent b307d2a0
...@@ -57,6 +57,7 @@ import java.util.LinkedList; ...@@ -57,6 +57,7 @@ import java.util.LinkedList;
import java.util.List; import java.util.List;
import static org.videolan.medialibrary.media.MediaLibraryItem.FLAG_SELECTED; 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 { public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, AudioBrowserAdapter.ViewHolder> implements FastScroller.SeparatedAdapter, Filterable {
...@@ -96,10 +97,12 @@ public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, Audio ...@@ -96,10 +97,12 @@ public class AudioBrowserAdapter extends SortableAdapter<MediaLibraryItem, Audio
public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) { public ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); LayoutInflater inflater = (LayoutInflater) parent.getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (viewType == MediaLibraryItem.TYPE_DUMMY) { if (viewType == MediaLibraryItem.TYPE_DUMMY) {
AudioBrowserSeparatorBinding binding = AudioBrowserSeparatorBinding.inflate(inflater, parent, false); final AudioBrowserSeparatorBinding binding = AudioBrowserSeparatorBinding.inflate(inflater, parent, false);
return new ViewHolder(binding); return new ViewHolder<>(binding);
} else { } 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); return new MediaItemViewHolder(binding);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment