update unread counter for image messages. fixes #2376

This commit is contained in:
Daniel Gultsch 2017-03-17 12:55:33 +01:00
parent ba32217152
commit 935ac25cbd

View File

@ -66,6 +66,12 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
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<Conversation> {
Pair<String,Boolean> 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()) {