[Android] Fix Thumbnail display for groups

Geoffrey Métais git at videolan.org
Fri May 27 11:28:08 CEST 2016


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 27 11:19:52 2016 +0200| [2df62a8d3a4d0bfc71ea561e1ec08664b5fa8554] | committer: Geoffrey Métais

Fix Thumbnail display for groups

> https://code.videolan.org/videolan/vlc-android/commit/2df62a8d3a4d0bfc71ea561e1ec08664b5fa8554
---

 vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java b/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
index 06aa9fd..2263318 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
@@ -40,6 +40,7 @@ import org.videolan.vlc.BR;
 import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.gui.audio.AudioBrowserListAdapter;
+import org.videolan.vlc.media.MediaGroup;
 import org.videolan.vlc.media.MediaWrapper;
 import org.videolan.vlc.util.HttpImageLoader;
 
@@ -191,6 +192,8 @@ public class AsyncImageLoader {
 
     @BindingAdapter({"bind:media", "bind:binding"})
     public static void loadPicture(ImageView v, MediaWrapper mw, ViewDataBinding vdb) {
+        if (mw instanceof MediaGroup)
+            mw = ((MediaGroup) mw).getFirstMedia();
         final Bitmap bitmap = mw.getType() == MediaWrapper.TYPE_VIDEO ?
                 BitmapUtil.getPictureFromCache(mw) :
                 AudioUtil.getCoverFromMemCache(v.getContext(), mw, 64);



More information about the Android mailing list