aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-12-28 14:17:58 +0100
committersteckbrief <steckbrief@chefmail.de>2016-12-28 14:17:58 +0100
commit7190f3c5406396bfbb8f128a07d2e74929502043 (patch)
tree14f517ece3e37189d6a3939d219be7d338c52116 /src/main/java/de
parente98aa48990d08b75f689c794bf720c5efe21a4b7 (diff)
Implement FS#239: Show number of unread messages in conversations overview
Diffstat (limited to 'src/main/java/de')
-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) {