[Android] Audio player: fix playlist item click

Adrien Maglo git at videolan.org
Fri Jan 24 18:17:34 CET 2014


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Fri Jan 24 18:17:25 2014 +0100| [82177f59bc34cdde74e97c6976a7de4b6f1fce51] | committer: Adrien Maglo

Audio player: fix playlist item click

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=82177f59bc34cdde74e97c6976a7de4b6f1fce51
---

 .../src/org/videolan/vlc/gui/audio/AudioListAdapter.java       |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
index 6f4014b..1c170bf 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
@@ -32,6 +32,7 @@ import android.content.res.ColorStateList;
 import android.view.LayoutInflater;
 import android.view.MotionEvent;
 import android.view.View;
+import android.view.View.OnClickListener;
 import android.view.View.OnTouchListener;
 import android.view.ViewGroup;
 import android.widget.ArrayAdapter;
@@ -100,6 +101,7 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
         final String title = media.getTitle();
         final String artist = media.getSubtitle();
         final int pos = position;
+        final View itemView = v;
 
         holder.title.setText(title);
         ColorStateList titleColor = v.getResources().getColorStateList(mCurrentIndex == position
@@ -129,6 +131,12 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
                 playlistView.removeItem(pos);
             }
         });
+        holder.layoutItem.setOnClickListener(new OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                playlistView.performItemClick(itemView, pos, 0);
+            }
+        });
 
         return v;
     }



More information about the Android mailing list