mirror of https://github.com/M66B/FairEmail.git
Optimization
This commit is contained in:
parent
10f5f33931
commit
460bad0b33
|
@ -1056,11 +1056,23 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
cowner.recreate();
|
cowner.recreate();
|
||||||
cowner.start();
|
cowner.start();
|
||||||
db.attachment().liveAttachments(message.id).observe(cowner, new Observer<List<EntityAttachment>>() {
|
db.attachment().liveAttachments(message.id).observe(cowner, new Observer<List<EntityAttachment>>() {
|
||||||
|
private int lastInlineImages = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onChanged(@Nullable List<EntityAttachment> attachments) {
|
public void onChanged(@Nullable List<EntityAttachment> attachments) {
|
||||||
bindAttachments(message, attachments);
|
bindAttachments(message, attachments);
|
||||||
|
|
||||||
|
int inlineImages = 0;
|
||||||
|
if (attachments != null)
|
||||||
|
for (EntityAttachment attachment : attachments)
|
||||||
|
if (attachment.available && attachment.isInline() && attachment.isImage())
|
||||||
|
inlineImages++;
|
||||||
|
|
||||||
|
if (inlineImages != lastInlineImages) {
|
||||||
|
lastInlineImages = inlineImages;
|
||||||
loadText(message, false);
|
loadText(message, false);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// Setup actions
|
// Setup actions
|
||||||
|
|
Loading…
Reference in New Issue