mirror of
https://github.com/M66B/FairEmail.git
synced 2025-01-01 12:44:42 +00:00
Recycle avatars
This commit is contained in:
parent
157cf110be
commit
bd952eafad
1 changed files with 9 additions and 1 deletions
|
@ -1263,8 +1263,10 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
if (info[0].hasPhoto()) {
|
if (info[0].hasPhoto()) {
|
||||||
ibAvatar.setImageBitmap(info[0].getPhotoBitmap());
|
ibAvatar.setImageBitmap(info[0].getPhotoBitmap());
|
||||||
ibAvatar.setVisibility(View.VISIBLE);
|
ibAvatar.setVisibility(View.VISIBLE);
|
||||||
} else
|
} else {
|
||||||
|
ibAvatar.setImageDrawable(null);
|
||||||
ibAvatar.setVisibility(View.GONE);
|
ibAvatar.setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
Uri lookupUri = info[0].getLookupUri();
|
Uri lookupUri = info[0].getLookupUri();
|
||||||
ibAvatar.setTag(lookupUri);
|
ibAvatar.setTag(lookupUri);
|
||||||
|
@ -5167,6 +5169,12 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
holder.powner.recreate();
|
holder.powner.recreate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onViewRecycled(@NonNull ViewHolder holder) {
|
||||||
|
if (holder.ibAvatar != null)
|
||||||
|
holder.ibAvatar.setImageDrawable(null);
|
||||||
|
}
|
||||||
|
|
||||||
void setSelectionTracker(SelectionTracker<Long> selectionTracker) {
|
void setSelectionTracker(SelectionTracker<Long> selectionTracker) {
|
||||||
this.selectionTracker = selectionTracker;
|
this.selectionTracker = selectionTracker;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue