diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2013-08-24 14:23:31 +0200 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2013-08-24 14:23:31 +0200 |
commit | 74b9bfdcc3b4a9465cb35c7aeddf87f8df7128be (patch) | |
tree | b2f8e8896c4ab09b5cec903d2e8b29b9eefac685 /src/de/danoeh/antennapod/asynctask | |
parent | 1376b5284849e198f2a2c8346d681d49d30a4234 (diff) | |
download | AntennaPod-74b9bfdcc3b4a9465cb35c7aeddf87f8df7128be.zip |
Added search, taglist, pocdasttaglist etc.
Diffstat (limited to 'src/de/danoeh/antennapod/asynctask')
-rw-r--r-- | src/de/danoeh/antennapod/asynctask/ImageDiskCache.java | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java b/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java index e0675982f..0179260cc 100644 --- a/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java +++ b/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java @@ -49,11 +49,16 @@ public class ImageDiskCache { if (path == null) { throw new NullPointerException(); } + if (cacheSingletons.containsKey(path)) { + return cacheSingletons.get(path); + } + ImageDiskCache cache = cacheSingletons.get(path); if (cache == null) { cache = new ImageDiskCache(path, maxCacheSize); cacheSingletons.put(new File(path).getAbsolutePath(), cache); } + cacheSingletons.put(path, cache); return cache; } @@ -75,7 +80,7 @@ public class ImageDiskCache { } executor = Executors.newFixedThreadPool(Runtime.getRuntime() - .availableProcessors()); + .availableProcessors() * 2); } private synchronized void initCacheFolder() { @@ -189,10 +194,11 @@ public class ImageDiskCache { } } target.setTag(R.id.image_disk_cache_key, url); + target.setImageResource(R.color.default_image_color); executor.submit(new ImageDownloader(url) { @Override protected void onImageLoaded(DiskCacheObject diskCacheObject) { - if (target.getTag(R.id.image_disk_cache_key) == url) { + if (target.getTag(R.id.image_disk_cache_key).equals(url)) { il.loadThumbnailBitmap(diskCacheObject.loadImage(), target, length); } } @@ -215,10 +221,11 @@ public class ImageDiskCache { } } target.setTag(R.id.image_disk_cache_key, url); + target.setImageResource(R.color.default_image_color); executor.submit(new ImageDownloader(url) { @Override protected void onImageLoaded(DiskCacheObject diskCacheObject) { - if (target.getTag(R.id.image_disk_cache_key) == url) { + if (target.getTag(R.id.image_disk_cache_key).equals(url)) { il.loadCoverBitmap(diskCacheObject.loadImage(), target, length); } } |