[Android] VideoGridFragment: do not show the menu on group item long click
Adrien Maglo
git at videolan.org
Fri Feb 21 13:11:45 CET 2014
vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Feb 21 13:11:34 2014 +0100| [13e5acbe26a6e0de1ffef0a2de69a44d6742bd3f] | committer: Adrien Maglo
VideoGridFragment: do not show the menu on group item long click
> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=13e5acbe26a6e0de1ffef0a2de69a44d6742bd3f
---
.../src/org/videolan/vlc/gui/video/VideoGridFragment.java | 7 +++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
index 4939ae6..0898c6b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoGridFragment.java
@@ -276,8 +276,6 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
private boolean handleContextItemSelected(MenuItem menu, int position) {
Media media = mVideoAdapter.getItem(position);
- if (media instanceof MediaGroup)
- return true;
switch (menu.getItemId())
{
case R.id.video_list_play:
@@ -314,6 +312,11 @@ public class VideoGridFragment extends SherlockGridFragment implements ISortable
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
+ // Do not show the menu of media group.
+ AdapterContextMenuInfo info = (AdapterContextMenuInfo)menuInfo;
+ Media media = mVideoAdapter.getItem(info.position);
+ if (media instanceof MediaGroup)
+ return;
MenuInflater inflater = getActivity().getMenuInflater();
inflater.inflate(R.menu.video_list, menu);
}
More information about the Android
mailing list