diff options
author | steckbrief <steckbrief@chefmail.de> | 2016-03-29 23:10:31 +0200 |
---|---|---|
committer | steckbrief <steckbrief@chefmail.de> | 2016-03-29 23:10:31 +0200 |
commit | 5021c1c194af85947c413f15e2ed8d28e4594b8a (patch) | |
tree | 039b6e19caa18f7154345099bd1a2f186251f57c /src/main/java/eu/siacs | |
parent | 074ff79fd9a6775157c5c4ed106ece86e0c912c2 (diff) | |
parent | 75659ddc1216ca9fa76826a641a22f5167fc1f9b (diff) |
Merge remote-tracking branch 'remotes/origin/trz/rename' into trz/rebase
Diffstat (limited to 'src/main/java/eu/siacs')
-rw-r--r-- | src/main/java/eu/siacs/conversations/ui/adapter/ConversationAdapter.java | 29 |
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(); |