From 4d2275189e2860604406f3f3fa11e5f43dec8a4b Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Sun, 15 Sep 2013 01:55:37 +0200 Subject: [PATCH] Resolved image display problems --- .../antennapod/adapter/ExternalEpisodesListAdapter.java | 1 - src/de/danoeh/antennapod/adapter/FeedlistAdapter.java | 1 - .../danoeh/antennapod/asynctask/BitmapDecodeWorkerTask.java | 4 ++-- src/de/danoeh/antennapod/asynctask/ImageDiskCache.java | 4 ++-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java index b3156f765..b00066eca 100644 --- a/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java +++ b/src/de/danoeh/antennapod/adapter/ExternalEpisodesListAdapter.java @@ -167,7 +167,6 @@ public class ExternalEpisodesListAdapter extends BaseExpandableListAdapter { holder.lenSize.setVisibility(View.INVISIBLE); } - holder.feedImage.setTag(item.getImageLoaderCacheKey()); ImageLoader.getInstance().loadThumbnailBitmap( item, holder.feedImage, diff --git a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java index 89427a47e..10013d7f2 100644 --- a/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java +++ b/src/de/danoeh/antennapod/adapter/FeedlistAdapter.java @@ -120,7 +120,6 @@ public class FeedlistAdapter extends BaseAdapter { } final String imageUrl = (feed.getImage() != null) ? feed.getImage() .getFile_url() : null; - holder.image.setTag(imageUrl); imageLoader.loadThumbnailBitmap( feed.getImage(), holder.image, diff --git a/src/de/danoeh/antennapod/asynctask/BitmapDecodeWorkerTask.java b/src/de/danoeh/antennapod/asynctask/BitmapDecodeWorkerTask.java index cb8e4d292..ef70c1e64 100644 --- a/src/de/danoeh/antennapod/asynctask/BitmapDecodeWorkerTask.java +++ b/src/de/danoeh/antennapod/asynctask/BitmapDecodeWorkerTask.java @@ -50,8 +50,8 @@ public class BitmapDecodeWorkerTask extends Thread { * before the bitmap was decoded */ protected boolean tagsMatching(ImageView target) { - return target.getTag(R.id.imageloader_key) == null - || target.getTag(R.id.imageloader_key).equals(imageResource.getImageLoaderCacheKey()); + Object tag = target.getTag(R.id.imageloader_key); + return tag != null && tag.equals(imageResource.getImageLoaderCacheKey()); } protected void onPostExecute() { diff --git a/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java b/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java index f7f6b576f..ae8bf8b87 100644 --- a/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java +++ b/src/de/danoeh/antennapod/asynctask/ImageDiskCache.java @@ -203,7 +203,7 @@ public class ImageDiskCache { @Override protected void onImageLoaded(DiskCacheObject diskCacheObject) { final Object tag = target.getTag(R.id.image_disk_cache_key); - if (tag != null || StringUtils.equals((String) tag, url)) { + if (tag != null && StringUtils.equals((String) tag, url)) { il.loadThumbnailBitmap(diskCacheObject.loadImage(), target, length); } } @@ -231,7 +231,7 @@ public class ImageDiskCache { @Override protected void onImageLoaded(DiskCacheObject diskCacheObject) { final Object tag = target.getTag(R.id.image_disk_cache_key); - if (tag != null || StringUtils.equals((String) tag, url)) { + if (tag != null && StringUtils.equals((String) tag, url)) { il.loadCoverBitmap(diskCacheObject.loadImage(), target, length); } }