diff options
author | Christian Schneppe <christian@pix-art.de> | 2017-04-26 20:19:06 +0200 |
---|---|---|
committer | Christian Schneppe <christian@pix-art.de> | 2017-04-26 20:19:06 +0200 |
commit | 3b6daca1c84282ae0530fd76cdf772476d815382 (patch) | |
tree | e6c22fe895f5e00202d3ac9eec3c0521c2843bef /src/main/java/de/pixart | |
parent | 2e7596fc27f2ef0b551af94b121fea7e66a4dea2 (diff) |
fixed click area for pgp key in contact details
Diffstat (limited to 'src/main/java/de/pixart')
-rw-r--r-- | src/main/java/de/pixart/messenger/ui/ContactDetailsActivity.java | 29 |
1 files changed, 12 insertions, 17 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); |