aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/ui/adapter
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/ui/adapter')
-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();