diff options
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java index 98a9a96c..97cf0739 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java @@ -112,19 +112,22 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { } String lastMessagePreview = ((null == msgPrefix || msgPrefix.isEmpty()) ? "" : (msgPrefix + ": ")) + msgText; mLastMessage.setText(lastMessagePreview); - if (preview.second) { + int lastMessageTypeface = Typeface.NORMAL; if (conversation.isRead()) { - mLastMessage.setTypeface(null, Typeface.ITALIC); - } else { - mLastMessage.setTypeface(null,Typeface.BOLD_ITALIC); + if (preview.second) { + lastMessageTypeface = Typeface.ITALIC; } } else { - if (conversation.isRead()) { - mLastMessage.setTypeface(null,Typeface.NORMAL); + TextView txtUnreadCount = (TextView) view.findViewById(R.id.conversation_unreadcount); + txtUnreadCount.setVisibility(View.VISIBLE); + txtUnreadCount.setText(String.valueOf(conversation.unreadCount())); + if (preview.second) { + lastMessageTypeface = Typeface.BOLD_ITALIC; } else { - mLastMessage.setTypeface(null,Typeface.BOLD); + lastMessageTypeface = Typeface.BOLD; } } + mLastMessage.setTypeface(null, lastMessageTypeface); } long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL,0); |