aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorDaniel Gultsch <daniel@gultsch.de>2016-01-08 14:41:55 +0100
committerDaniel Gultsch <daniel@gultsch.de>2016-01-08 14:41:55 +0100
commit0bb3ae37f0762ad264a4b98b3ebc4753017441af (patch)
tree08468db535d0aea54c54a735e5eb3bf8e482d9b7 /src/main/java
parent5dd5685885150ad5ba20e299e40b04762bdb05d4 (diff)
show icon in conversations overview when notifications are disabled
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java12
1 files changed, 12 insertions, 0 deletions
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 a4a80dc4b..302faaf10 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<Conversation> {
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<Conversation> {
}
}
+ 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);