Fixed avatar issue in history list
This commit is contained in:
parent
e28e3f78bd
commit
0b643e27d4
2 changed files with 9 additions and 1 deletions
|
@ -181,7 +181,7 @@ public class CallHistoryAdapter extends SelectableAdapter<CallHistoryAdapter.Vie
|
|||
if (c != null) {
|
||||
ContactAvatar.displayAvatar(c, holder.avatarLayout);
|
||||
} else {
|
||||
ContactAvatar.displayAvatar(displayName, holder.avatarLayout);
|
||||
ContactAvatar.displayAvatar(holder.contact.getText().toString(), holder.avatarLayout);
|
||||
}
|
||||
|
||||
holder.detail.setVisibility(isEditionEnabled() ? View.INVISIBLE : View.VISIBLE);
|
||||
|
|
|
@ -44,6 +44,12 @@ class ContactAvatarHolder {
|
|||
securityLevel = v.findViewById(R.id.security_level);
|
||||
generatedAvatar = v.findViewById(R.id.generated_avatar);
|
||||
}
|
||||
|
||||
public void init() {
|
||||
contactPicture.setVisibility(View.VISIBLE);
|
||||
generatedAvatar.setVisibility(View.VISIBLE);
|
||||
securityLevel.setVisibility(View.GONE);
|
||||
}
|
||||
}
|
||||
|
||||
public class ContactAvatar {
|
||||
|
@ -66,6 +72,7 @@ public class ContactAvatar {
|
|||
if (displayName == null || v == null) return;
|
||||
|
||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||
holder.init();
|
||||
|
||||
if (displayName.startsWith("+")) {
|
||||
// If display name is a phone number, use default avatar because generated one will be +...
|
||||
|
@ -82,6 +89,7 @@ public class ContactAvatar {
|
|||
|
||||
Bitmap bm = null;
|
||||
ContactAvatarHolder holder = new ContactAvatarHolder(v);
|
||||
holder.init();
|
||||
|
||||
if (contact.getThumbnailUri() != null && contact.getThumbnailUri().getScheme().startsWith("http")) {
|
||||
bm = LinphoneUtils.downloadBitmap(contact.getThumbnailUri());
|
||||
|
|
Loading…
Reference in a new issue