aboutsummaryrefslogtreecommitdiffstats
path: root/src/eu/siacs/conversations
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2014-03-15 00:19:42 +0100
committerDaniel Gultsch <daniel@gultsch.de>2014-03-15 00:19:42 +0100
commit8f9712c64e712108ac3e25b28de4646b7454f52d (patch)
treeba0a8a1d2b24eee261c6fe7b8cb2245cc3c4e8e4 /src/eu/siacs/conversations
parentb0d57d01c4b3c9e37fdb4786ccc123f5de866f9c (diff)
added security indicator on every single message
Diffstat (limited to 'src/eu/siacs/conversations')
-rw-r--r--src/eu/siacs/conversations/ui/ConversationFragment.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/eu/siacs/conversations/ui/ConversationFragment.java b/src/eu/siacs/conversations/ui/ConversationFragment.java
index d8ead9a6..7385d8a9 100644
--- a/src/eu/siacs/conversations/ui/ConversationFragment.java
+++ b/src/eu/siacs/conversations/ui/ConversationFragment.java
@@ -239,6 +239,7 @@ public class ConversationFragment extends Fragment {
.findViewById(R.id.message_body);
viewHolder.time = (TextView) view
.findViewById(R.id.message_time);
+ viewHolder.indicator = (ImageView) view.findViewById(R.id.security_indicator);
view.setTag(viewHolder);
} else {
viewHolder = (ViewHolder) view.getTag();
@@ -266,12 +267,22 @@ public class ConversationFragment extends Fragment {
viewHolder.messageBody.setTextColor(0xff33B5E5);
viewHolder.messageBody.setTypeface(null,
Typeface.ITALIC);
+ viewHolder.indicator.setVisibility(View.VISIBLE);
+ } else if ((item.getEncryption() == Message.ENCRYPTION_OTR)||(item.getEncryption() == Message.ENCRYPTION_DECRYPTED)) {
+ viewHolder.messageBody.setText(body.trim());
+ viewHolder.messageBody.setTextColor(0xff000000);
+ viewHolder.messageBody.setTypeface(null,
+ Typeface.NORMAL);
+ viewHolder.indicator.setVisibility(View.VISIBLE);
} else {
viewHolder.messageBody.setText(body.trim());
viewHolder.messageBody.setTextColor(0xff000000);
viewHolder.messageBody.setTypeface(null,
Typeface.NORMAL);
+ viewHolder.indicator.setVisibility(View.GONE);
}
+ } else {
+ viewHolder.indicator.setVisibility(View.GONE);
}
if (item.getStatus() == Message.STATUS_UNSEND) {
viewHolder.time.setTypeface(null, Typeface.ITALIC);
@@ -554,6 +565,7 @@ public class ConversationFragment extends Fragment {
private static class ViewHolder {
+ protected ImageView indicator;
protected TextView time;
protected TextView messageBody;
protected ImageView imageView;