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
1 changed files with 6 additions and 6 deletions

View File

@ -66,6 +66,12 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
Message message = conversation.getLatestMessage(); Message message = conversation.getLatestMessage();
int unreadCount = conversation.unreadCount(); int unreadCount = conversation.unreadCount();
if (unreadCount > 0) {
unreadCountCustomView.setVisibility(View.VISIBLE);
unreadCountCustomView.setUnreadCount(unreadCount);
} else {
unreadCountCustomView.setVisibility(View.GONE);
}
if (!conversation.isRead()) { if (!conversation.isRead()) {
convName.setTypeface(null, Typeface.BOLD); convName.setTypeface(null, Typeface.BOLD);
@ -84,12 +90,6 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
Pair<String,Boolean> preview = UIHelper.getMessagePreview(activity,message); Pair<String,Boolean> preview = UIHelper.getMessagePreview(activity,message);
mLastMessage.setVisibility(View.VISIBLE); mLastMessage.setVisibility(View.VISIBLE);
imagePreview.setVisibility(View.GONE); imagePreview.setVisibility(View.GONE);
if (unreadCount > 0) {
unreadCountCustomView.setVisibility(View.VISIBLE);
unreadCountCustomView.setUnreadCount(unreadCount);
} else {
unreadCountCustomView.setVisibility(View.GONE);
}
mLastMessage.setText(preview.first); mLastMessage.setText(preview.first);
if (preview.second) { if (preview.second) {
if (conversation.isRead()) { if (conversation.isRead()) {