[Android] UI : Don't scale default image when there is no thumbnail

Alexandre Perraud git at videolan.org
Wed Feb 25 16:03:23 CET 2015


vlc-ports/android | branch: master | Alexandre Perraud <4leyx4ndre at gmail.com> | Mon Feb 23 16:06:35 2015 +0100| [7f85a5d37d1502403aa4640ff7ac6741b88fb95d] | committer: Alexandre Perraud

UI : Don't scale default image when there is no thumbnail

> http://git.videolan.org/gitweb.cgi/vlc-ports/android.git/?a=commit;h=7f85a5d37d1502403aa4640ff7ac6741b88fb95d
---

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
index 7adb908..ed7d096 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -177,12 +177,15 @@ public class VideoListAdapter extends ArrayAdapter<MediaWrapper>
 
         /* Thumbnail */
         Bitmap thumbnail = BitmapUtil.getPictureFromCache(media);
+        holder.thumbnail.setScaleType(ImageView.ScaleType.FIT_CENTER);
         if (thumbnail == null) {
             // missing thumbnail
+            holder.thumbnail.setScaleType(ImageView.ScaleType.CENTER);
             thumbnail = BitmapCache.GetFromResource(v, R.drawable.ic_cone_o);
         }
         else if (thumbnail.getWidth() == 1 && thumbnail.getHeight() == 1) {
             // dummy thumbnail
+            holder.thumbnail.setScaleType(ImageView.ScaleType.CENTER);
             thumbnail = BitmapCache.GetFromResource(v, R.drawable.ic_cone_o);
         }
         //FIXME Warning: the thumbnails are upscaled in the grid view!



More information about the Android mailing list