aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/de/thedevstack/conversationsplus/utils
diff options
context:
space:
mode:
authorsteckbrief <steckbrief@chefmail.de>2016-03-29 11:43:22 +0200
committersteckbrief <steckbrief@chefmail.de>2016-03-29 11:43:22 +0200
commit6244834096727cfc1aaaeba7845a6d9cfe27d2b0 (patch)
treebc532e86b2bfca9afbcfcfc4c383b48ecb287ea4 /src/main/java/de/thedevstack/conversationsplus/utils
parent0c0676b7dbf87e24ebcc4714adfb10d91e3d72b8 (diff)
Implements FS#173: Move access to colors to separate helper class
Diffstat (limited to 'src/main/java/de/thedevstack/conversationsplus/utils')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java b/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
index 1c142dad..f27aabb6 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/UIHelper.java
@@ -12,6 +12,7 @@ import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
+import de.thedevstack.conversationsplus.ConversationsPlusColors;
import de.thedevstack.conversationsplus.R;
import de.thedevstack.conversationsplus.entities.Contact;
import de.thedevstack.conversationsplus.entities.Conversation;
@@ -242,19 +243,21 @@ public class UIHelper {
}
}
- public static String getStatusColor(Presence.Status status) {
- switch (status) {
- case ONLINE:
- case CHAT:
- return "#259B23";
- case AWAY:
- case XA:
- return "#FF9800";
- case DND:
- return "#E51C23";
- }
- return "#CCCCCC";
- }
+ public static int getStatusColor(Presence.Status status) {
+ switch (status) {
+ case ONLINE:
+ return ConversationsPlusColors.online();
+ case CHAT:
+ return ConversationsPlusColors.chat();
+ case AWAY:
+ return ConversationsPlusColors.away();
+ case XA:
+ return ConversationsPlusColors.xa();
+ case DND:
+ return ConversationsPlusColors.dnd();
+ }
+ return ConversationsPlusColors.offline();
+ }
private static String getDisplayedMucCounterpart(final Jid counterpart) {
if (counterpart==null) {