[Android] TV: Fix default icon display for audio files
Geoffrey Métais
git at videolan.org
Thu Dec 20 14:07:25 CET 2018
vlc-android | branch: master | Geoffrey Métais <geoffrey.metais at gmail.com> | Thu Dec 20 14:06:59 2018 +0100| [18dac664acd2d01547f7a8a14efe5353cf634e9e] | committer: Geoffrey Métais
TV: Fix default icon display for audio files
> https://code.videolan.org/videolan/vlc-android/commit/18dac664acd2d01547f7a8a14efe5353cf634e9e
---
vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 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 655bd9ec8..ee2ca8d97 100644
--- a/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/tv/CardPresenter.java
@@ -29,9 +29,6 @@ import android.graphics.drawable.BitmapDrawable;
import android.graphics.drawable.Drawable;
import android.net.Uri;
import android.os.Build;
-import androidx.leanback.widget.ImageCardView;
-import androidx.leanback.widget.Presenter;
-import androidx.core.content.ContextCompat;
import android.text.TextUtils;
import android.view.View;
import android.view.ViewGroup;
@@ -49,6 +46,10 @@ import org.videolan.vlc.util.Settings;
import java.util.List;
+import androidx.core.content.ContextCompat;
+import androidx.leanback.widget.ImageCardView;
+import androidx.leanback.widget.Presenter;
+
@TargetApi(Build.VERSION_CODES.JELLY_BEAN_MR1)
public class CardPresenter extends Presenter {
@@ -85,7 +86,8 @@ public class CardPresenter extends Presenter {
final MediaWrapper media = (MediaWrapper) item;
final boolean group = media.getType() == MediaWrapper.TYPE_GROUP;
final boolean folder = media.getType() == MediaWrapper.TYPE_DIR;
- if (!folder && (group || !media.isThumbnailGenerated())) {
+ final boolean video = media.getType() == MediaWrapper.TYPE_VIDEO;
+ if (!folder && (group || (video && !media.isThumbnailGenerated()))) {
ImageLoaderKt.loadImage(mCardView, item);
return;
}
More information about the Android
mailing list