aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java31
1 files changed, 17 insertions, 14 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,20 +112,23 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
}
String lastMessagePreview = ((null == msgPrefix || msgPrefix.isEmpty()) ? "" : (msgPrefix + ": ")) + msgText;
mLastMessage.setText(lastMessagePreview);
- if (preview.second) {
- if (conversation.isRead()) {
- mLastMessage.setTypeface(null, Typeface.ITALIC);
- } else {
- mLastMessage.setTypeface(null,Typeface.BOLD_ITALIC);
- }
- } else {
- if (conversation.isRead()) {
- mLastMessage.setTypeface(null,Typeface.NORMAL);
- } else {
- mLastMessage.setTypeface(null,Typeface.BOLD);
- }
- }
- }
+ int lastMessageTypeface = Typeface.NORMAL;
+ if (conversation.isRead()) {
+ if (preview.second) {
+ 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 {
+ lastMessageTypeface = Typeface.BOLD;
+ }
+ }
+ mLastMessage.setTypeface(null, lastMessageTypeface);
+ }
long muted_till = conversation.getLongAttribute(Conversation.ATTRIBUTE_MUTED_TILL,0);
if (muted_till == Long.MAX_VALUE) {