[Android] TV: Show Details screen on long click

Geoffrey Métais git at videolan.org
Mon Apr 18 16:07:05 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Mon Apr 18 14:53:59 2016 +0200| [6decce21884f79e19679e5673a3de0ee50126b6c] | committer: Geoffrey Métais

TV: Show Details screen on long click

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

 vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
index 2f38631..494aaec 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -107,7 +107,7 @@ public class CardPresenter extends Presenter {
     }
 
     @Override
-    public void onBindViewHolder(Presenter.ViewHolder viewHolder, Object item) {
+    public void onBindViewHolder(Presenter.ViewHolder viewHolder, final Object item) {
         ViewHolder holder = ((ViewHolder) viewHolder);
         if (item instanceof MediaWrapper) {
             MediaWrapper mediaWrapper = (MediaWrapper) item;
@@ -118,6 +118,13 @@ public class CardPresenter extends Presenter {
                         R.drawable.ic_video_collection_big));
             else
                 holder.updateCardViewImage(mediaWrapper);
+            holder.view.setOnLongClickListener(new View.OnLongClickListener() {
+                @Override
+                public boolean onLongClick(View v) {
+                    TvUtil.showMediaDetail(v.getContext(), (MediaWrapper) item);
+                    return true;
+                }
+            });
         } else if (item instanceof MusicFragment.ListItem) {
             MusicFragment.ListItem listItem = (MusicFragment.ListItem) item;
             MediaWrapper MediaWrapper = listItem.mediaList.get(0);



More information about the Android mailing list