aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java29
1 files changed, 9 insertions, 20 deletions
diff --git a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
index 31e54a0d..a1f77d26 100644
--- a/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
+++ b/src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java
@@ -69,28 +69,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();