[Android] TV: Fix default media icons display

Geoffrey Métais git at videolan.org
Wed Feb 13 17:05:48 CET 2019


vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Wed Feb 13 16:27:40 2019 +0100| [5ef0dbc33f5821417822c7f5c8743cea25896118] | committer: Geoffrey Métais

TV: Fix default media icons display

> https://code.videolan.org/videolan/vlc-android/commit/5ef0dbc33f5821417822c7f5c8743cea25896118
---

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

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 ee2ca8d97..b661b62b5 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -88,8 +88,12 @@ public class CardPresenter extends Presenter {
                 final boolean folder = media.getType() == MediaWrapper.TYPE_DIR;
                 final boolean video = media.getType() == MediaWrapper.TYPE_VIDEO;
                 if (!folder && (group || (video && !media.isThumbnailGenerated()))) {
-                     ImageLoaderKt.loadImage(mCardView, item);
-                     return;
+                    if (noArt) {
+                        mCardView.getMainImageView().setScaleType(ImageView.ScaleType.FIT_CENTER);
+                        mCardView.setMainImage(new BitmapDrawable(mCardView.getResources(), getDefaultImage(item)));
+                    }
+                    ImageLoaderKt.loadImage(mCardView, item);
+                    return;
                 }
             }
             if (noArt) {



More information about the Android mailing list