Use internal contact viewer for avatar clicks.

This commit is contained in:
Greyson Parrelli
2020-03-02 08:33:25 -05:00
parent b06152ba58
commit fd2a464bae
3 changed files with 14 additions and 21 deletions

View File

@@ -16,6 +16,7 @@ import androidx.appcompat.widget.AppCompatImageView;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import org.thoughtcrime.securesms.R;
import org.thoughtcrime.securesms.RecipientPreferenceActivity;
import org.thoughtcrime.securesms.color.MaterialColor;
import org.thoughtcrime.securesms.contacts.avatars.ContactColors;
import org.thoughtcrime.securesms.contacts.avatars.ContactPhoto;
@@ -149,12 +150,8 @@ public final class AvatarImageView extends AppCompatImageView {
private void setAvatarClickHandler(final Recipient recipient, boolean quickContactEnabled) {
super.setOnClickListener(v -> {
if (!recipient.isGroup() && quickContactEnabled) {
if (recipient.getContactUri() != null) {
ContactsContract.QuickContact.showQuickContact(getContext(), AvatarImageView.this, recipient.getContactUri(), ContactsContract.QuickContact.MODE_LARGE, null);
} else {
getContext().startActivity(RecipientExporter.export(recipient).asAddContactIntent());
}
if (quickContactEnabled) {
getContext().startActivity(RecipientPreferenceActivity.getLaunchIntent(getContext(), recipient.getId()));
} else if (listener != null) {
listener.onClick(v);
}