aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java29
-rw-r--r--src/main/res/layout/contact.xml2
-rw-r--r--src/main/res/layout/contact_key.xml6
3 files changed, 17 insertions, 20 deletions
diff --git a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
index 8a2e72145..1c54d2ff3 100644
--- a/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
+++ b/src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java
@@ -2,11 +2,9 @@ package de.pixart.messenger.ui;
import android.app.ActionBar;
import android.app.AlertDialog;
-import android.app.PendingIntent;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
-import android.content.IntentSender.SendIntentException;
import android.content.SharedPreferences;
import android.net.Uri;
import android.os.Bundle;
@@ -611,26 +609,23 @@ public class ContactDetailsActivity extends OmemoActivity implements OnAccountUp
keyType.setTextColor(ContextCompat.getColor(this, R.color.accent));
}
key.setText(OpenPgpUtils.convertKeyIdToHex(contact.getPgpKeyId()));
- view.setOnClickListener(new OnClickListener() {
+ final OnClickListener openKey = new OnClickListener() {
@Override
public void onClick(View v) {
- PgpEngine pgp = ContactDetailsActivity.this.xmppConnectionService
- .getPgpEngine();
- if (pgp != null) {
- PendingIntent intent = pgp.getIntentForKey(contact);
- if (intent != null) {
- try {
- startIntentSenderForResult(
- intent.getIntentSender(), 0, null, 0,
- 0, 0);
- } catch (SendIntentException e) {
-
- }
- }
+ PgpEngine pgp = ContactDetailsActivity.this.xmppConnectionService.getPgpEngine();
+ try {
+ startIntentSenderForResult(
+ pgp.getIntentForKey(contact).getIntentSender(), 0, null, 0,
+ 0, 0);
+ } catch (Throwable e) {
+ Toast.makeText(ContactDetailsActivity.this, R.string.openpgp_error, Toast.LENGTH_SHORT).show();
}
}
- });
+ };
+ view.setOnClickListener(openKey);
+ key.setOnClickListener(openKey);
+ keyType.setOnClickListener(openKey);
keys.addView(view);
}
keysWrapper.setVisibility(hasKeys ? View.VISIBLE : View.GONE);
diff --git a/src/main/res/layout/contact.xml b/src/main/res/layout/contact.xml
index 0abda4cf2..3637d52bd 100644
--- a/src/main/res/layout/contact.xml
+++ b/src/main/res/layout/contact.xml
@@ -53,7 +53,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textColor="@color/black87"
- android:textSize="?attr/TextSizeHeadline"
+ android:textSize="?attr/TextSizeBody"
android:typeface="monospace"
android:fontFamily="monospace"
android:visibility="gone" />
diff --git a/src/main/res/layout/contact_key.xml b/src/main/res/layout/contact_key.xml
index 63a4e8518..0edd1aea3 100644
--- a/src/main/res/layout/contact_key.xml
+++ b/src/main/res/layout/contact_key.xml
@@ -23,7 +23,8 @@
android:textSize="?attr/TextSizeBody"
android:typeface="monospace"
android:fontFamily="monospace"
- android:longClickable="true" />
+ android:longClickable="true"
+ android:clickable="true" />
<TextView
android:id="@+id/key_type"
@@ -34,7 +35,8 @@
android:layout_below="@+id/key"
android:maxLines="1"
android:textSize="?attr/TextSizeInfo"
- android:longClickable="true" />
+ android:longClickable="true"
+ android:clickable="true" />
<TextView
android:id="@+id/key_trust"