From 0bb3ae37f0762ad264a4b98b3ebc4753017441af Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 8 Jan 2016 14:41:55 +0100 Subject: show icon in conversations overview when notifications are disabled --- .../siacs/conversations/ui/adapter/ConversationAdapter.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/main/java/eu') diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java index a4a80dc4..302faaf1 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -59,6 +59,7 @@ public class ConversationAdapter extends ArrayAdapter { TextView mLastMessage = (TextView) view.findViewById(R.id.conversation_lastmsg); TextView mTimestamp = (TextView) view.findViewById(R.id.conversation_lastupdate); ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage); + ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status); Message message = conversation.getLatestMessage(); @@ -94,6 +95,17 @@ public class ConversationAdapter extends ArrayAdapter { } } + long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL,0); + if (muted_till == Long.MAX_VALUE) { + notificationStatus.setVisibility(View.VISIBLE); + notificationStatus.setImageResource(R.drawable.ic_notifications_off_grey600_24dp); + } else if (muted_till >= System.currentTimeMillis()) { + notificationStatus.setVisibility(View.VISIBLE); + notificationStatus.setImageResource(R.drawable.ic_notifications_paused_grey600_24dp); + } else { + notificationStatus.setVisibility(View.GONE); + } + mTimestamp.setText(UIHelper.readableTimeDifference(activity,conversation.getLatestMessage().getTimeSent())); ImageView profilePicture = (ImageView) view.findViewById(R.id.conversation_image); loadAvatar(conversation,profilePicture); -- cgit v1.2.3