aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/eu/siacs
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-12-09 18:46:32 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-12-09 18:46:32 +0100
commit8abfbf82fab1f51d5a3c13bba8c19b3d92de8eca (patch)
treee55c3a5330f90d42fe224d18b703f3b0984628c6 /src/main/java/eu/siacs
parent8d127f70d067636c9839fc9b8dd1e7d6507ef61d (diff)
use verified symbol instead of colored lock icons
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java33
1 files changed, 13 insertions, 20 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
index 66c60ca5..d09c70ea 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/MessageAdapter.java
@@ -211,31 +211,24 @@ public class MessageAdapter extends ArrayAdapter<Message> implements CopyTextVie
if (message.getEncryption() == Message.ENCRYPTION_NONE) {
viewHolder.indicator.setVisibility(View.GONE);
} else {
- viewHolder.indicator.setImageResource(darkBackground ? R.drawable.ic_lock_white_18dp : R.drawable.ic_lock_black_18dp);
- viewHolder.indicator.setVisibility(View.VISIBLE);
+ boolean verified = false;
if (message.getEncryption() == Message.ENCRYPTION_AXOLOTL) {
- FingerprintStatus status = message.getConversation()
+ final FingerprintStatus status = message.getConversation()
.getAccount().getAxolotlService().getFingerprintTrust(
message.getFingerprint());
-
- if(status == null || (type == SENT ? !status.isTrusted() : (!status.isVerified() && inValidSession))) {
- viewHolder.indicator.setColorFilter(0xffc64545);
- viewHolder.indicator.setAlpha(1.0f);
- } else {
- viewHolder.indicator.clearColorFilter();
- if (darkBackground) {
- viewHolder.indicator.setAlpha(0.7f);
- } else {
- viewHolder.indicator.setAlpha(0.57f);
- }
+ if (status != null && status.isVerified()) {
+ verified = true;
}
+ }
+ if (verified) {
+ viewHolder.indicator.setImageResource(darkBackground ? R.drawable.ic_verified_user_white_18dp : R.drawable.ic_verified_user_black_18dp);
} else {
- viewHolder.indicator.clearColorFilter();
- if (darkBackground) {
- viewHolder.indicator.setAlpha(0.7f);
- } else {
- viewHolder.indicator.setAlpha(0.57f);
- }
+ viewHolder.indicator.setImageResource(darkBackground ? R.drawable.ic_lock_white_18dp : R.drawable.ic_lock_black_18dp);
+ }
+ if (darkBackground) {
+ viewHolder.indicator.setAlpha(0.7f);
+ } else {
+ viewHolder.indicator.setAlpha(0.57f);
}
}