[Android] Use a static to store the default cover/thumbnail

Ludovic Fauvet git at videolan.org
Mon Oct 15 15:23:22 CEST 2012


vlc-ports/android | branch: master | Ludovic Fauvet <etix at videolan.org> | Mon Oct 15 15:21:08 2012 +0200| [cab597d14860935af9ee31cf6c9cd0402dcada01] | committer: Ludovic Fauvet

Use a static to store the default cover/thumbnail

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

 vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java |    5 +++--
 vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
index 47e6598..9f1236c 100644
--- a/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/audio/AudioListAdapter.java
@@ -42,13 +42,14 @@ public class AudioListAdapter extends ArrayAdapter<Media> {
 
     private ArrayList<Media> mMediaList;
     private int mCurrentIndex;
-    private Bitmap mDefaultCover;
+    private static Bitmap mDefaultCover;
 
     public AudioListAdapter(Context context) {
         super(context, 0);
         mMediaList = new ArrayList<Media>();
         mCurrentIndex = -1;
-        mDefaultCover = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon);
+        if (mDefaultCover == null)
+            mDefaultCover = BitmapFactory.decodeResource(context.getResources(), R.drawable.icon);
     }
 
     @Override
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 58780f3..bf0c2f6 100644
--- a/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
+++ b/vlc-android/src/org/videolan/vlc/gui/video/VideoListAdapter.java
@@ -48,7 +48,7 @@ public class VideoListAdapter extends ArrayAdapter<Media>
     private int mSortDirection = 1;
     private int mSortBy = SORT_BY_TITLE;
     private boolean mListMode = false;
-    private Bitmap mDefaultThumbnail;
+    private static Bitmap mDefaultThumbnail;
 
     public VideoListAdapter(Context context) {
         super(context, 0);



More information about the Android mailing list