diff options
-rw-r--r-- | src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java | 8 |
1 files changed, 5 insertions, 3 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 97cf0739..e0e672e3 100644 --- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java +++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java @@ -68,6 +68,7 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { 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); + TextView txtUnreadCount = (TextView) view.findViewById(R.id.conversation_unreadcount); if (Settings.SHOW_ONLINE_STATUS) { int color = ConversationsPlusColors.offline(); @@ -84,11 +85,15 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { Message message = conversation.getLatestMessage(); + int txtUnreadCountVisibility = View.INVISIBLE; if (!conversation.isRead()) { convName.setTypeface(null, Typeface.BOLD); + txtUnreadCountVisibility = View.VISIBLE; + txtUnreadCount.setText(String.valueOf(conversation.unreadCount())); } else { convName.setTypeface(null, Typeface.NORMAL); } + txtUnreadCount.setVisibility(txtUnreadCountVisibility); if ((null != message.getFileParams() && message.getFileParams().getWidth() > 0) // TODO: Use FileParams.getMimeType() && (message.getTransferable() == null @@ -118,9 +123,6 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> { lastMessageTypeface = Typeface.ITALIC; } } else { - 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 { |