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); diff --git a/src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 00000000..96b329c4 Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_notifications_grey600_24dp.png differ diff --git a/src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 00000000..09ebc5d2 Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_notifications_off_grey600_24dp.png differ diff --git a/src/main/res/drawable-hdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-hdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 00000000..e92d43ac Binary files /dev/null and b/src/main/res/drawable-hdpi/ic_notifications_paused_grey600_24dp.png differ diff --git a/src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 00000000..d6c20c20 Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_notifications_grey600_24dp.png differ diff --git a/src/main/res/drawable-mdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-mdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 00000000..af3b6321 Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_notifications_off_grey600_24dp.png differ diff --git a/src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 00000000..9d6308d2 Binary files /dev/null and b/src/main/res/drawable-mdpi/ic_notifications_paused_grey600_24dp.png differ diff --git a/src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 00000000..d441dc7c Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_notifications_grey600_24dp.png differ diff --git a/src/main/res/drawable-xhdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-xhdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 00000000..aef303a0 Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_notifications_off_grey600_24dp.png differ diff --git a/src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 00000000..c68bedd3 Binary files /dev/null and b/src/main/res/drawable-xhdpi/ic_notifications_paused_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-xxhdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 00000000..7d58d25d Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_notifications_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-xxhdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 00000000..e627b30a Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_notifications_off_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 00000000..e38f5217 Binary files /dev/null and b/src/main/res/drawable-xxhdpi/ic_notifications_paused_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png b/src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png new file mode 100644 index 00000000..98dff2f3 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_notifications_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxxhdpi/ic_notifications_off_grey600_24dp.png b/src/main/res/drawable-xxxhdpi/ic_notifications_off_grey600_24dp.png new file mode 100644 index 00000000..ab65f4b2 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_notifications_off_grey600_24dp.png differ diff --git a/src/main/res/drawable-xxxhdpi/ic_notifications_paused_grey600_24dp.png b/src/main/res/drawable-xxxhdpi/ic_notifications_paused_grey600_24dp.png new file mode 100644 index 00000000..53162e56 Binary files /dev/null and b/src/main/res/drawable-xxxhdpi/ic_notifications_paused_grey600_24dp.png differ diff --git a/src/main/res/layout/conversation_list_row.xml b/src/main/res/layout/conversation_list_row.xml index 7321b0f6..984073b3 100644 --- a/src/main/res/layout/conversation_list_row.xml +++ b/src/main/res/layout/conversation_list_row.xml @@ -1,88 +1,109 @@ + xmlns:app="http://schemas.android.com/apk/res-auto" + android:layout_width="fill_parent" + android:layout_height="wrap_content" + android:descendantFocusability="blocksDescendants"> - + - + - + - + - + - + - + - + + - - + + + + - - - - + + + + \ No newline at end of file