From 6214026be8bb86275af2af753cc35da72e61f457 Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Fri, 16 Nov 2012 20:20:55 +0100 Subject: [PATCH] Save only one image in the cover cache --- .../antennapod/asynctask/FeedImageLoader.java | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java index 4e77e9f4d..3070cbea7 100644 --- a/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java +++ b/src/de/danoeh/antennapod/asynctask/FeedImageLoader.java @@ -38,7 +38,6 @@ public class FeedImageLoader { .getSystemService(Context.ACTIVITY_SERVICE)).getMemoryClass(); // Use 1/8th of the available memory for this memory cache. - final int coverCacheSize = 1024 * 1024 * memClass / 8; final int thumbnailCacheSize = 1024 * 1024 * memClass / 8; private LruCache coverCache; @@ -48,20 +47,7 @@ public class FeedImageLoader { handler = new Handler(); executor = createExecutor(); - coverCache = new LruCache(coverCacheSize) { - - @SuppressLint("NewApi") - @Override - protected int sizeOf(String key, CachedBitmap value) { - if (Integer.valueOf(android.os.Build.VERSION.SDK_INT) >= 12) - return value.getBitmap().getByteCount(); - else - return (value.getBitmap().getRowBytes() * value.getBitmap() - .getHeight()); - - } - - }; + coverCache = new LruCache(1); thumbnailCache = new LruCache(thumbnailCacheSize) {