compose: add workaround for glide sometimes not loading contact pictures

This commit is contained in:
Vincent Breitmoser 2016-01-09 01:12:15 +01:00
parent 284a13070a
commit 67541a60cb

View file

@ -126,11 +126,13 @@ public class RecipientAdapter extends BaseAdapter implements Filterable {
}
public static void setContactPhotoOrPlaceholder(Context context, ImageView imageView, Recipient recipient) {
imageView.setImageDrawable(null);
// TODO don't use two different mechanisms for loading!
if (recipient.photoThumbnailUri != null) {
Glide.with(context).load(recipient.photoThumbnailUri).into(imageView);
Glide.with(context).load(recipient.photoThumbnailUri)
// for some reason, this fixes loading issues.
.placeholder(null)
.dontAnimate()
.into(imageView);
} else {
ContactPicture.getContactPictureLoader(context).loadContactPicture(recipient.address, imageView);
}