[Android] HistoryAdapter: fix album art

Edward Wang git at videolan.org
Tue Sep 10 01:10:36 CEST 2013


vlc-ports/android | branch: 0.1.x-bugfix | Edward Wang <edward.c.wang at compdigitec.com> | Sun Sep  1 16:08:24 2013 +0200| [cb28e4829c907b89a5477f521672e61b84534f00] | committer: Jean-Baptiste Kempf

HistoryAdapter: fix album art

(cherry picked from commit e910fdfa3e7dc35ab265e933cda7d0b97a8155d4)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
index 3cb3a1a..f44ced8 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -31,7 +31,9 @@ import org.videolan.vlc.R;
 import org.videolan.vlc.Util;
 import org.videolan.vlc.VLCApplication;
 import org.videolan.vlc.WeakHandler;
+import org.videolan.vlc.gui.audio.AudioUtil;
 
+import android.graphics.Bitmap;
 import android.os.Message;
 import android.util.Log;
 import android.view.LayoutInflater;
@@ -102,7 +104,11 @@ public class HistoryAdapter extends BaseAdapter {
         holderText = m.getSubtitle();
 
         holder.text.setText(holderText);
-        holder.icon.setImageResource(R.drawable.icon);
+        Bitmap b = AudioUtil.getCover(VLCApplication.getAppContext(), m, 64);
+        if(b != null)
+            holder.icon.setImageBitmap(b);
+        else
+            holder.icon.setImageResource(R.drawable.icon);
 
         return v;
     }



More information about the Android mailing list