[Android] HistoryAdapter: fix album art

Edward Wang git at videolan.org
Sun Sep 1 16:30:42 CEST 2013


vlc-ports/android | branch: master | Edward Wang <edward.c.wang at compdigitec.com> | Sun Sep  1 16:08:24 2013 +0200| [e910fdfa3e7dc35ab265e933cda7d0b97a8155d4] | committer: Edward Wang

HistoryAdapter: fix album art

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

 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 c4e06e4..bcb79ee 100644
--- a/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/HistoryAdapter.java
@@ -30,7 +30,9 @@ import org.videolan.vlc.MediaDatabase;
 import org.videolan.vlc.R;
 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;
@@ -111,7 +113,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