Add back a way to access quick contact from conversation

Closes #7051
// FREEBIE
master
Christian Ascheberg 2017-10-05 20:07:44 +02:00 committed by Moxie Marlinspike
parent 23a23ebd72
commit 69e656af76
2 changed files with 19 additions and 0 deletions

View File

@ -856,6 +856,18 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
}
}
private boolean handleDisplayQuickContact() {
if (recipient.getAddress().isGroup()) return false;
if (recipient.getContactUri() != null) {
ContactsContract.QuickContact.showQuickContact(ConversationActivity.this, titleView, recipient.getContactUri(), ContactsContract.QuickContact.MODE_LARGE, null);
} else {
handleAddToContacts();
}
return true;
}
private void handleAddAttachment() {
if (this.isMmsEnabled || isSecureText) {
if (attachmentTypeSelector == null) {
@ -1209,6 +1221,7 @@ public class ConversationActivity extends PassphraseRequiredActionBarActivity
});
titleView.setOnClickListener(v -> handleConversationSettings());
titleView.setOnLongClickListener(v -> handleDisplayQuickContact());
titleView.setOnBackClickedListener(view -> super.onBackPressed());
unblockButton.setOnClickListener(v -> handleUnblock());
makeDefaultSmsButton.setOnClickListener(v -> handleMakeDefaultSms());

View File

@ -84,6 +84,12 @@ public class ConversationTitleView extends RelativeLayout {
this.avatar.setOnClickListener(listener);
}
@Override
public void setOnLongClickListener(@Nullable OnLongClickListener listener) {
this.content.setOnLongClickListener(listener);
this.avatar.setOnLongClickListener(listener);
}
public void setOnBackClickedListener(@Nullable OnClickListener listener) {
this.back.setOnClickListener(listener);
}