mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-27 16:33:47 +00:00
Fixed jitter
This commit is contained in:
parent
4f9453c22e
commit
75ce2a4250
1 changed files with 8 additions and 5 deletions
|
@ -1056,14 +1056,17 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
||||||
ibAvatar.setTag(lookupUri);
|
ibAvatar.setTag(lookupUri);
|
||||||
ibAvatar.setEnabled(lookupUri != null);
|
ibAvatar.setEnabled(lookupUri != null);
|
||||||
|
|
||||||
if (addresses != null && addresses.length == 1) {
|
// Updating in message lists causes jitter
|
||||||
|
if (viewType == ViewType.THREAD) {
|
||||||
String displayName = info.getDisplayName();
|
String displayName = info.getDisplayName();
|
||||||
if (!TextUtils.isEmpty(displayName)) {
|
if (!TextUtils.isEmpty(displayName) &&
|
||||||
|
addresses != null && addresses.length == 1) {
|
||||||
|
String email = ((InternetAddress) addresses[0]).getAddress();
|
||||||
String personal = ((InternetAddress) addresses[0]).getPersonal();
|
String personal = ((InternetAddress) addresses[0]).getPersonal();
|
||||||
if (TextUtils.isEmpty(personal))
|
if (TextUtils.isEmpty(personal) || !personal.equals(displayName))
|
||||||
try {
|
try {
|
||||||
((InternetAddress) addresses[0]).setPersonal(displayName);
|
InternetAddress a = new InternetAddress(email, displayName);
|
||||||
tvFrom.setText(MessageHelper.formatAddresses(addresses, name_email, false));
|
tvFrom.setText(MessageHelper.formatAddresses(new Address[]{a}, name_email, false));
|
||||||
} catch (UnsupportedEncodingException ex) {
|
} catch (UnsupportedEncodingException ex) {
|
||||||
Log.w(ex);
|
Log.w(ex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue