kopia lustrzana https://github.com/ryukoposting/Signal-Android
Fix main thread recipient resolve in contact selection.
rodzic
8be659c1c8
commit
263ddb0d1e
|
@ -38,6 +38,10 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientF
|
||||||
private String number;
|
private String number;
|
||||||
private String chipName;
|
private String chipName;
|
||||||
private int contactType;
|
private int contactType;
|
||||||
|
private String contactName;
|
||||||
|
private String contactNumber;
|
||||||
|
private String contactLabel;
|
||||||
|
private String contactAbout;
|
||||||
private LiveRecipient recipient;
|
private LiveRecipient recipient;
|
||||||
private GlideRequests glideRequests;
|
private GlideRequests glideRequests;
|
||||||
|
|
||||||
|
@ -74,6 +78,10 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientF
|
||||||
this.glideRequests = glideRequests;
|
this.glideRequests = glideRequests;
|
||||||
this.number = number;
|
this.number = number;
|
||||||
this.contactType = type;
|
this.contactType = type;
|
||||||
|
this.contactName = name;
|
||||||
|
this.contactNumber = number;
|
||||||
|
this.contactLabel = label;
|
||||||
|
this.contactAbout = about;
|
||||||
|
|
||||||
if (type == ContactRepository.NEW_PHONE_TYPE || type == ContactRepository.NEW_USERNAME_TYPE) {
|
if (type == ContactRepository.NEW_PHONE_TYPE || type == ContactRepository.NEW_USERNAME_TYPE) {
|
||||||
this.recipient = null;
|
this.recipient = null;
|
||||||
|
@ -88,9 +96,13 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientF
|
||||||
|
|
||||||
this.nameView.setTextColor(color);
|
this.nameView.setTextColor(color);
|
||||||
this.numberView.setTextColor(color);
|
this.numberView.setTextColor(color);
|
||||||
|
if (recipientSnapshot == null || recipientSnapshot.isResolving()) {
|
||||||
|
this.contactPhotoImage.setAvatar(glideRequests, null, false);
|
||||||
|
setText(null, type, name, number, label, about);
|
||||||
|
} else {
|
||||||
this.contactPhotoImage.setAvatar(glideRequests, recipientSnapshot, false);
|
this.contactPhotoImage.setAvatar(glideRequests, recipientSnapshot, false);
|
||||||
|
|
||||||
setText(recipientSnapshot, type, name, number, label, about);
|
setText(recipientSnapshot, type, name, number, label, about);
|
||||||
|
}
|
||||||
|
|
||||||
this.checkBox.setVisibility(checkboxVisible ? View.VISIBLE : View.GONE);
|
this.checkBox.setVisibility(checkboxVisible ? View.VISIBLE : View.GONE);
|
||||||
}
|
}
|
||||||
|
@ -178,9 +190,6 @@ public class ContactSelectionListItem extends LinearLayout implements RecipientF
|
||||||
@Override
|
@Override
|
||||||
public void onRecipientChanged(@NonNull Recipient recipient) {
|
public void onRecipientChanged(@NonNull Recipient recipient) {
|
||||||
contactPhotoImage.setAvatar(glideRequests, recipient, false);
|
contactPhotoImage.setAvatar(glideRequests, recipient, false);
|
||||||
nameView.setText(recipient);
|
setText(recipient, contactType, contactName, contactNumber, contactLabel, contactAbout);
|
||||||
if (recipient.isGroup()) {
|
|
||||||
numberView.setText(getGroupMemberCount(recipient));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Ładowanie…
Reference in New Issue