From 935ac25cbd229c4fe973b4e962c76831fd718fa0 Mon Sep 17 00:00:00 2001 From: Daniel Gultsch Date: Fri, 17 Mar 2017 12:55:33 +0100 Subject: [PATCH] update unread counter for image messages. fixes #2376 --- .../ui/adapter/ConversationAdapter.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 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 b793f9a1f..daa569de5 100644 --- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java +++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java @@ -66,6 +66,12 @@ public class ConversationAdapter extends ArrayAdapter { Message message = conversation.getLatestMessage(); int unreadCount = conversation.unreadCount(); + if (unreadCount > 0) { + unreadCountCustomView.setVisibility(View.VISIBLE); + unreadCountCustomView.setUnreadCount(unreadCount); + } else { + unreadCountCustomView.setVisibility(View.GONE); + } if (!conversation.isRead()) { convName.setTypeface(null, Typeface.BOLD); @@ -84,12 +90,6 @@ public class ConversationAdapter extends ArrayAdapter { Pair preview = UIHelper.getMessagePreview(activity,message); mLastMessage.setVisibility(View.VISIBLE); imagePreview.setVisibility(View.GONE); - if (unreadCount > 0) { - unreadCountCustomView.setVisibility(View.VISIBLE); - unreadCountCustomView.setUnreadCount(unreadCount); - } else { - unreadCountCustomView.setVisibility(View.GONE); - } mLastMessage.setText(preview.first); if (preview.second) { if (conversation.isRead()) {