Always fill in contact names again

pull/170/head
M66B 6 years ago
parent fd223d6d4c
commit 2876e12c7f

@ -1058,22 +1058,19 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
ibAvatar.setTag(lookupUri); ibAvatar.setTag(lookupUri);
ibAvatar.setEnabled(lookupUri != null); ibAvatar.setEnabled(lookupUri != null);
// 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) { addresses != null && addresses.length == 1) {
String email = ((InternetAddress) addresses[0]).getAddress(); String email = ((InternetAddress) addresses[0]).getAddress();
String personal = ((InternetAddress) addresses[0]).getPersonal(); String personal = ((InternetAddress) addresses[0]).getPersonal();
if (TextUtils.isEmpty(personal) || !personal.equals(displayName)) if (TextUtils.isEmpty(personal))
try { try {
InternetAddress a = new InternetAddress(email, displayName); InternetAddress a = new InternetAddress(email, displayName, StandardCharsets.UTF_8.name());
tvFrom.setText(MessageHelper.formatAddresses(new Address[]{a}, 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);
} }
} }
}
if (distinguish_contacts && info.isKnown()) if (distinguish_contacts && info.isKnown())
tvFrom.setPaintFlags(tvFrom.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG); tvFrom.setPaintFlags(tvFrom.getPaintFlags() | Paint.UNDERLINE_TEXT_FLAG);

Loading…
Cancel
Save