diff options
author | Andreas Straub <andy@strb.org> | 2015-07-29 20:21:37 +0200 |
---|---|---|
committer | Andreas Straub <andy@strb.org> | 2015-07-29 20:21:37 +0200 |
commit | 2b3bb0226121acb173080e4893421eefef4a9571 (patch) | |
tree | 4d0c34dc9114557c7d5b288e46a038fc93ff53cd /src/main/java/eu/siacs/conversations/ui/XmppActivity.java | |
parent | e07853ea6267304b5380e77b794a3f906b06aca4 (diff) |
Highlight selected message's fingerprint in list
Diffstat (limited to '')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/XmppActivity.java | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java index 857a1dc43..3093db467 100644 --- a/src/main/java/eu/siacs/conversations/ui/XmppActivity.java +++ b/src/main/java/eu/siacs/conversations/ui/XmppActivity.java @@ -424,10 +424,15 @@ public abstract class XmppActivity extends Activity { } public void switchToContactDetails(Contact contact) { + switchToContactDetails(contact, null); + } + + public void switchToContactDetails(Contact contact, String messageFingerprint) { Intent intent = new Intent(this, ContactDetailsActivity.class); intent.setAction(ContactDetailsActivity.ACTION_VIEW_CONTACT); intent.putExtra("account", contact.getAccount().getJid().toBareJid().toString()); intent.putExtra("contact", contact.getJid().toString()); + intent.putExtra("fingerprint", messageFingerprint); startActivity(intent); } @@ -608,11 +613,11 @@ public abstract class XmppActivity extends Activity { builder.create().show(); } - protected boolean addFingerprintRow(LinearLayout keys, final Account account, IdentityKey identityKey) { + protected boolean addFingerprintRow(LinearLayout keys, final Account account, IdentityKey identityKey, boolean highlight) { final String fingerprint = identityKey.getFingerprint().replaceAll("\\s", ""); final SQLiteAxolotlStore.Trust trust = account.getAxolotlService() .getFingerprintTrust(fingerprint); - return addFingerprintRowWithListeners(keys, account, identityKey, trust, true, + return addFingerprintRowWithListeners(keys, account, identityKey, highlight, trust, true, new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { @@ -636,12 +641,13 @@ public abstract class XmppActivity extends Activity { } protected boolean addFingerprintRowWithListeners(LinearLayout keys, final Account account, - final IdentityKey identityKey, - SQLiteAxolotlStore.Trust trust, - boolean showTag, - CompoundButton.OnCheckedChangeListener - onCheckedChangeListener, - View.OnClickListener onClickListener) { + final IdentityKey identityKey, + boolean highlight, + SQLiteAxolotlStore.Trust trust, + boolean showTag, + CompoundButton.OnCheckedChangeListener + onCheckedChangeListener, + View.OnClickListener onClickListener) { if (trust == SQLiteAxolotlStore.Trust.COMPROMISED) { return false; } @@ -688,6 +694,12 @@ public abstract class XmppActivity extends Activity { } else { keyType.setVisibility(View.GONE); } + if (highlight) { + keyType.setTextColor(getResources().getColor(R.color.accent)); + keyType.setText(getString(R.string.axolotl_fingerprint_selected_message)); + } else { + keyType.setText(getString(R.string.axolotl_fingerprint)); + } key.setText(CryptoHelper.prettifyFingerprint(identityKey.getFingerprint())); keys.addView(view); |