[Android] src: Fix clicking in directory view

Edward Wang git at videolan.org
Fri Aug 3 02:07:24 CEST 2012


android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Thu Aug  2 20:02:08 2012 -0400| [081717dacc751574d1daec43f8766bf96edbe56f] | committer: Edward Wang

src: Fix clicking in directory view

> http://git.videolan.org/gitweb.cgi/android.git/?a=commit;h=081717dacc751574d1daec43f8766bf96edbe56f
---

 vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java     |    4 ----
 .../src/org/videolan/vlc/gui/DirectoryViewFragment.java        |    8 ++++++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
index eb10681..30c0acd 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryAdapter.java
@@ -282,10 +282,6 @@ public class DirectoryAdapter extends BaseAdapter {
         else
             holder.icon.setImageResource(R.drawable.ic_folder);
 
-        if(selectedNode.isFile())
-            v.setLongClickable(true);
-        else
-            v.setLongClickable(false);
         return v;
     }
 
diff --git a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
index 64a015e..51b953b 100644
--- a/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
+++ b/vlc-android/src/org/videolan/vlc/gui/DirectoryViewFragment.java
@@ -84,8 +84,12 @@ public class DirectoryViewFragment extends SherlockListFragment implements ISort
 
     @Override
     public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
-        MenuInflater menuInflater = getActivity().getMenuInflater();
-        menuInflater.inflate(R.menu.directory_view, menu);
+        int position = ((AdapterContextMenuInfo)menuInfo).position;
+
+        if(mDirectoryAdapter.isChildFile(position)) {
+            MenuInflater menuInflater = getActivity().getMenuInflater();
+            menuInflater.inflate(R.menu.directory_view, menu);
+        }
     }
 
     @Override



More information about the Android mailing list