[Android] Use ImageComposer for video groups thumbnail

Geoffrey Métais git at videolan.org
Fri May 26 17:15:51 CEST 2017


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Fri May 26 17:15:13 2017 +0200| [76930a0d0c393322ca2a857d8697753cf95b3def] | committer: Geoffrey Métais

Use ImageComposer for video groups thumbnail

> https://code.videolan.org/videolan/vlc-android/commit/76930a0d0c393322ca2a857d8697753cf95b3def
---

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

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 3a646f554..2cffd5d2d 100644
--- a/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
+++ b/vlc-android/src/org/videolan/vlc/gui/helpers/AsyncImageLoader.java
@@ -45,6 +45,7 @@ import org.videolan.vlc.R;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.media.MediaGroup;
 import org.videolan.vlc.util.HttpImageLoader;
+import org.videolan.vlc.util.ImageComposer;
 
 public class AsyncImageLoader {
 
@@ -93,10 +94,8 @@ public class AsyncImageLoader {
             updateTargetImage(bitmap, v, DataBindingUtil.findBinding(v));
             return;
         }
-        if (item.getItemType() == MediaLibraryItem.TYPE_MEDIA) {
+        if (item.getItemType() == MediaLibraryItem.TYPE_MEDIA && ((MediaWrapper)item).getType() != MediaWrapper.TYPE_GROUP) {
             MediaWrapper mw = (MediaWrapper) item;
-            if (mw.getType() == MediaWrapper.TYPE_GROUP)
-                mw = ((MediaGroup)mw).getFirstMedia();
             int type = mw.getType();
             boolean isMedia = type == MediaWrapper.TYPE_AUDIO || type == MediaWrapper.TYPE_VIDEO;
             Uri uri = mw.getUri();
@@ -137,6 +136,8 @@ public class AsyncImageLoader {
             if (bindChanged)
                 return null;
             String artworkUrl = item.getArtworkMrl();
+            if (item instanceof MediaGroup)
+                return ImageComposer.composeImage((MediaGroup) item);
             if (!TextUtils.isEmpty(artworkUrl) && artworkUrl.startsWith("http"))
                 return HttpImageLoader.downloadBitmap(artworkUrl);
             return AudioUtil.readCoverBitmap(Uri.decode(item.getArtworkMrl()), width);



More information about the Android mailing list