From 8f9712c64e712108ac3e25b28de4646b7454f52d Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Sat, 15 Mar 2014 00:19:42 +0100 Subject: added security indicator on every single message --- src/eu/siacs/conversations/ui/ConversationFragment.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') 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; -- cgit v1.2.3