diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/ui/adapter')
3 files changed, 9 insertions, 6 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index f5f48a262..34c9d7b32 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -126,12 +126,12 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { @Override protected Bitmap doInBackground(Conversation... params) { - return activity.avatarService().get(params[0], activity.getPixel(56)); + return activity.avatarService().get(params[0], activity.getPixel(56), isCancelled()); } @Override protected void onPostExecute(Bitmap bitmap) { - if (bitmap != null) { + if (bitmap != null && !isCancelled()) { final ImageView imageView = imageViewReference.get(); if (imageView != null) { imageView.setImageBitmap(bitmap); @@ -145,6 +145,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { if (cancelPotentialWork(conversation, imageView)) { final Bitmap bm = activity.avatarService().get(conversation, activity.getPixel(56), true); if (bm != null) { + cancelPotentialWork(conversation, imageView); imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); } else { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java index da8e39101..c29b01bcf 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ListItemAdapter.java @@ -62,7 +62,7 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> { ImageView picture = (ImageView) view.findViewById(R.id.contact_photo); LinearLayout tagLayout = (LinearLayout) view.findViewById(R.id.tags); - List<ListItem.Tag> tags = item.getTags(); + List<ListItem.Tag> tags = item.getTags(activity); if (tags.size() == 0 || !this.showDynamicTags) { tagLayout.setVisibility(View.GONE); } else { @@ -106,12 +106,12 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> { @Override protected Bitmap doInBackground(ListItem... params) { - return activity.avatarService().get(params[0], activity.getPixel(48)); + return activity.avatarService().get(params[0], activity.getPixel(48), isCancelled()); } @Override protected void onPostExecute(Bitmap bitmap) { - if (bitmap != null) { + if (bitmap != null && !isCancelled()) { final ImageView imageView = imageViewReference.get(); if (imageView != null) { imageView.setImageBitmap(bitmap); @@ -125,6 +125,7 @@ public class ListItemAdapter extends ArrayAdapter<ListItem> { if (cancelPotentialWork(item, imageView)) { final Bitmap bm = activity.avatarService().get(item,activity.getPixel(48),true); if (bm != null) { + cancelPotentialWork(item, imageView); imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); } else { diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java index d69fa4b95..88ce1dfd5 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java @@ -760,7 +760,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { @Override protected void onPostExecute(Bitmap bitmap) { - if (bitmap != null) { + if (bitmap != null && !isCancelled()) { final ImageView imageView = imageViewReference.get(); if (imageView != null) { imageView.setImageBitmap(bitmap); @@ -774,6 +774,7 @@ public class MessageAdapter extends ArrayAdapter<Message> { if (cancelPotentialWork(message, imageView)) { final Bitmap bm = activity.avatarService().get(message, activity.getPixel(48), true); if (bm != null) { + cancelPotentialWork(message, imageView); imageView.setImageBitmap(bm); imageView.setBackgroundColor(0x00000000); } else { |