mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 14:41:08 +00:00
Fixed showing empty photos
This commit is contained in:
parent
6039fc1383
commit
84be266b7c
1 changed files with 6 additions and 2 deletions
|
@ -151,12 +151,16 @@ public class AdapterMessage extends PagedListAdapter<TupleMessageEx, AdapterMess
|
|||
|
||||
itemView.setAlpha(viewType == ViewType.THREAD && EntityFolder.ARCHIVE.equals(message.folderType) ? 0.5f : 1.0f);
|
||||
|
||||
boolean photo = false;
|
||||
if (avatars && message.avatar != null) {
|
||||
ContentResolver resolver = context.getContentResolver();
|
||||
InputStream is = ContactsContract.Contacts.openContactPhotoInputStream(resolver, Uri.parse(message.avatar));
|
||||
ivAvatar.setImageDrawable(Drawable.createFromStream(is, "avatar"));
|
||||
if (is != null) {
|
||||
photo = true;
|
||||
ivAvatar.setImageDrawable(Drawable.createFromStream(is, "avatar"));
|
||||
}
|
||||
}
|
||||
ivAvatar.setVisibility(!avatars || message.avatar == null ? View.GONE : View.VISIBLE);
|
||||
ivAvatar.setVisibility(photo ? View.VISIBLE : View.GONE);
|
||||
|
||||
if (avatars && message.from != null && message.from.length > 0) {
|
||||
final long id = message.id;
|
||||
|
|
Loading…
Reference in a new issue