mirror of https://github.com/M66B/FairEmail.git
Reduced conversation view flicker
This commit is contained in:
parent
6346f408a6
commit
c00351f3de
|
@ -443,7 +443,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
ivAddContact.setVisibility(viewType == ViewType.THREAD && show_expanded && contacts && message.from != null ? View.VISIBLE : View.GONE);
|
ivAddContact.setVisibility(viewType == ViewType.THREAD && show_expanded && contacts && message.from != null ? View.VISIBLE : View.GONE);
|
||||||
pbHeaders.setVisibility(View.GONE);
|
pbHeaders.setVisibility(View.GONE);
|
||||||
grpHeaders.setVisibility(show_headers && show_expanded ? View.VISIBLE : View.GONE);
|
grpHeaders.setVisibility(show_headers && show_expanded ? View.VISIBLE : View.GONE);
|
||||||
bnvActions.setVisibility(View.GONE);
|
bnvActions.setVisibility(viewType == ViewType.THREAD && show_expanded ? View.INVISIBLE : View.GONE);
|
||||||
vSeparatorBody.setVisibility(View.GONE);
|
vSeparatorBody.setVisibility(View.GONE);
|
||||||
btnHtml.setVisibility(View.GONE);
|
btnHtml.setVisibility(View.GONE);
|
||||||
btnImages.setVisibility(View.GONE);
|
btnImages.setVisibility(View.GONE);
|
||||||
|
@ -1601,7 +1601,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
@Override
|
@Override
|
||||||
public boolean areContentsTheSame(
|
public boolean areContentsTheSame(
|
||||||
@NonNull TupleMessageEx prev, @NonNull TupleMessageEx next) {
|
@NonNull TupleMessageEx prev, @NonNull TupleMessageEx next) {
|
||||||
return prev.equals(next);
|
return prev.uiEquals(next);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,50 @@ public class EntityMessage implements Serializable {
|
||||||
HtmlHelper.sanitize(EntityMessage.read(context, id)));
|
HtmlHelper.sanitize(EntityMessage.read(context, id)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean uiEquals(Object obj) {
|
||||||
|
if (obj instanceof EntityMessage) {
|
||||||
|
EntityMessage other = (EntityMessage) obj;
|
||||||
|
return (true &&
|
||||||
|
//(this.account == null ? other.account == null : this.account.equals(other.account)) &&
|
||||||
|
//this.folder.equals(other.folder) &&
|
||||||
|
//(this.identity == null ? other.identity == null : this.identity.equals(other.identity)) &&
|
||||||
|
//(this.replying == null ? other.replying == null : this.replying.equals(other.replying)) &&
|
||||||
|
//(this.forwarding == null ? other.forwarding == null : this.forwarding.equals(other.forwarding)) &&
|
||||||
|
//(this.uid == null ? other.uid == null : this.uid.equals(other.uid)) &&
|
||||||
|
(this.msgid == null ? other.msgid == null : this.msgid.equals(other.msgid)) && // debug info
|
||||||
|
//(this.references == null ? other.references == null : this.references.equals(other.references)) &&
|
||||||
|
//(this.deliveredto == null ? other.deliveredto == null : this.deliveredto.equals(other.deliveredto)) &&
|
||||||
|
//(this.inreplyto == null ? other.inreplyto == null : this.inreplyto.equals(other.inreplyto)) &&
|
||||||
|
(this.thread == null ? other.thread == null : this.thread.equals(other.thread)) &&
|
||||||
|
(this.avatar == null ? other.avatar == null : this.avatar.equals(other.avatar)) &&
|
||||||
|
equal(this.from, other.from) &&
|
||||||
|
equal(this.to, other.to) &&
|
||||||
|
equal(this.cc, other.cc) &&
|
||||||
|
equal(this.bcc, other.bcc) &&
|
||||||
|
equal(this.reply, other.reply) &&
|
||||||
|
(this.headers == null ? other.headers == null : this.headers.equals(other.headers)) &&
|
||||||
|
(this.subject == null ? other.subject == null : this.subject.equals(other.subject)) &&
|
||||||
|
(this.size == null ? other.size == null : this.size.equals(other.size)) &&
|
||||||
|
this.content == other.content &&
|
||||||
|
(this.preview == null ? other.preview == null : this.preview.equals(other.preview)) &&
|
||||||
|
//(this.sent == null ? other.sent == null : this.sent.equals(other.sent)) &&
|
||||||
|
this.received.equals(other.received) &&
|
||||||
|
//this.stored.equals(other.stored) &&
|
||||||
|
//this.seen.equals(other.seen) &&
|
||||||
|
//this.answered.equals(other.answered) &&
|
||||||
|
//this.flagged.equals(other.flagged) &&
|
||||||
|
Helper.equal(this.keywords, other.keywords) &&
|
||||||
|
this.ui_seen.equals(other.ui_seen) &&
|
||||||
|
this.ui_answered.equals(other.ui_answered) &&
|
||||||
|
this.ui_flagged.equals(other.ui_flagged) &&
|
||||||
|
this.ui_hide.equals(other.ui_hide) &&
|
||||||
|
this.ui_found.equals(other.ui_found) &&
|
||||||
|
this.ui_ignored.equals(other.ui_ignored) &&
|
||||||
|
(this.error == null ? other.error == null : this.error.equals(other.error)));
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof EntityMessage) {
|
if (obj instanceof EntityMessage) {
|
||||||
|
|
|
@ -32,6 +32,11 @@ public class TupleMessageEx extends EntityMessage {
|
||||||
public int attachments;
|
public int attachments;
|
||||||
public boolean duplicate;
|
public boolean duplicate;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean uiEquals(Object obj) {
|
||||||
|
return super.uiEquals(obj);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj instanceof TupleMessageEx) {
|
if (obj instanceof TupleMessageEx) {
|
||||||
|
@ -49,6 +54,6 @@ public class TupleMessageEx extends EntityMessage {
|
||||||
this.attachments == other.attachments &&
|
this.attachments == other.attachments &&
|
||||||
this.duplicate == other.duplicate);
|
this.duplicate == other.duplicate);
|
||||||
}
|
}
|
||||||
return super.equals(obj);
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue