|
|
@ -58,21 +58,18 @@ public class AvatarImageView extends ImageView {
|
|
|
|
|
|
|
|
|
|
|
|
private void setAvatarClickHandler(final Recipient recipient, boolean quickContactEnabled) {
|
|
|
|
private void setAvatarClickHandler(final Recipient recipient, boolean quickContactEnabled) {
|
|
|
|
if (!recipient.isGroupRecipient() && quickContactEnabled) {
|
|
|
|
if (!recipient.isGroupRecipient() && quickContactEnabled) {
|
|
|
|
setOnClickListener(new View.OnClickListener() {
|
|
|
|
super.setOnClickListener(v -> {
|
|
|
|
@Override
|
|
|
|
if (recipient.getContactUri() != null) {
|
|
|
|
public void onClick(View v) {
|
|
|
|
ContactsContract.QuickContact.showQuickContact(getContext(), AvatarImageView.this, recipient.getContactUri(), ContactsContract.QuickContact.MODE_LARGE, null);
|
|
|
|
if (recipient.getContactUri() != null) {
|
|
|
|
} else {
|
|
|
|
ContactsContract.QuickContact.showQuickContact(getContext(), AvatarImageView.this, recipient.getContactUri(), ContactsContract.QuickContact.MODE_LARGE, null);
|
|
|
|
final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
|
|
|
|
|
|
|
|
if (recipient.getAddress().isEmail()) {
|
|
|
|
|
|
|
|
intent.putExtra(ContactsContract.Intents.Insert.EMAIL, recipient.getAddress().toEmailString());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
final Intent intent = new Intent(Intent.ACTION_INSERT_OR_EDIT);
|
|
|
|
intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipient.getAddress().toPhoneString());
|
|
|
|
if (recipient.getAddress().isEmail()) {
|
|
|
|
|
|
|
|
intent.putExtra(ContactsContract.Intents.Insert.EMAIL, recipient.getAddress().toEmailString());
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
intent.putExtra(ContactsContract.Intents.Insert.PHONE, recipient.getAddress().toPhoneString());
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
|
|
|
|
|
|
|
|
getContext().startActivity(intent);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
intent.setType(ContactsContract.Contacts.CONTENT_ITEM_TYPE);
|
|
|
|
|
|
|
|
getContext().startActivity(intent);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|