[Android] Audio browser: display the cover of a media item in case we can fetch one

Adrien Maglo git at videolan.org
Tue Nov 19 17:47:03 CET 2013


vlc-ports/android | branch: master | Adrien Maglo <magsoft at videolan.org> | Tue Nov 19 17:46:51 2013 +0100| [23756b90a2477baa30e4e777224e752ae94d69ce] | committer: Adrien Maglo

Audio browser: display the cover of a media item in case we can fetch one

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

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

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
index d41bbd4..29d80f8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioBrowserListAdapter.java
@@ -145,9 +145,10 @@ public class AudioBrowserListAdapter implements ListAdapter {
 
         RelativeLayout.LayoutParams paramsCover;
         if (mItemType == ITEM_WITH_COVER) {
-            /*Bitmap cover = AudioUtil.getCover(v.getContext(), media, 64);
-            if (cover == null)*/
-            Bitmap cover = BitmapCache.GetFromResource(v, R.drawable.icon);
+            Media media = mItems.get(position).mMediaList.get(0);
+            Bitmap cover = AudioUtil.getCover(v.getContext(), media, 64);
+            if (cover == null)
+                cover = BitmapCache.GetFromResource(v, R.drawable.icon);
             holder.cover.setImageBitmap(cover);
             int size = (int) mContext.getResources().getDimension(R.dimen.audio_browser_item_size);
             paramsCover = new RelativeLayout.LayoutParams(size, size);



More information about the Android mailing list