aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-03-29 23:09:43 +0200
committersteckbrief <steckbrief@chefmail.de>2016-03-29 23:09:43 +0200
commit75659ddc1216ca9fa76826a641a22f5167fc1f9b (patch)
treed339b6a31c89a4e73d2cf836fac1a46443947169 /src/main/java/de
parent37c5a7c5224890e24363c991f48ac316aae6af14 (diff)
Fixes FS#172: Conversations list not updated on status changes
Diffstat (limited to 'src/main/java/de')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java29
1 files changed, 9 insertions, 20 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 37b8aa18..53e1462f 100644
--- a/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/de/thedevstack/conversationsplus/ui/adapter/ConversationAdapter.java
@@ -68,28 +68,17 @@ public class ConversationAdapter extends ArrayAdapter<Conversation> {
ImageView imagePreview = (ImageView) view.findViewById(R.id.conversation_lastimage);
ImageView notificationStatus = (ImageView) view.findViewById(R.id.notification_status);
- if (Settings.SHOW_ONLINE_STATUS && conversation.getAccount().getStatus() == Account.State.ONLINE) {
- TextView status = (TextView) view.findViewById(R.id.status);
-
- String color = "#000000";
- if (conversation.getMode() == Conversation.MODE_SINGLE) {
- switch (conversation.getContact().getMostAvailableStatus()) {
- case ONLINE:
- case CHAT:
- color = "#259B23";
- break;
- case AWAY:
- case XA:
- color = "#FF9800";
- break;
- case DND:
- color = "#E51C23";
- break;
+ if (Settings.SHOW_ONLINE_STATUS) {
+ int color = ConversationsPlusColors.offline();
+ if (conversation.getAccount().getStatus() == Account.State.ONLINE) {
+ if (conversation.getMode() == Conversation.MODE_SINGLE) {
+ color = UIHelper.getStatusColor(conversation.getContact().getMostAvailableStatus());
+ } else if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getMucOptions().online()) {
+ color = ConversationsPlusColors.online();
}
- } else if (conversation.getMode() == Conversation.MODE_MULTI && conversation.getMucOptions().online()) {
- color = "#259B23";
}
- status.setBackgroundColor(Color.parseColor(color));
+ TextView status = (TextView) view.findViewById(R.id.status);
+ status.setBackgroundColor(color);
}
Message message = conversation.getLatestMessage();