From b6584dfd0b3a7347c7788143fda486f18a1518ee Mon Sep 17 00:00:00 2001 From: steckbrief Date: Tue, 26 May 2015 22:28:31 +0200 Subject: Status color added to "create conversation" (refers to ticket #22 in flyspray) --- .../java/de/thedevstack/conversationsplus/entities/Bookmark.java | 7 +++++++ .../java/de/thedevstack/conversationsplus/entities/Contact.java | 6 ++++++ .../java/de/thedevstack/conversationsplus/entities/ListItem.java | 2 ++ 3 files changed, 15 insertions(+) (limited to 'src/main/java/de/thedevstack/conversationsplus/entities') diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/Bookmark.java b/src/main/java/de/thedevstack/conversationsplus/entities/Bookmark.java index ea7df2f2..8a6b1405 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/Bookmark.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/Bookmark.java @@ -1,5 +1,7 @@ package de.thedevstack.conversationsplus.entities; +import android.graphics.Color; + import java.util.ArrayList; import java.util.List; import java.util.Locale; @@ -74,6 +76,11 @@ public class Bookmark extends Element implements ListItem { return tags; } + @Override + public int getStatusColor() { + return Color.parseColor("#259B23"); + } + public String getNick() { Element nick = this.findChild("nick"); if (nick != null) { diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/Contact.java b/src/main/java/de/thedevstack/conversationsplus/entities/Contact.java index 07d42d28..c4f1c9eb 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/Contact.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/Contact.java @@ -2,6 +2,7 @@ package de.thedevstack.conversationsplus.entities; import android.content.ContentValues; import android.database.Cursor; +import android.graphics.Color; import org.json.JSONArray; import org.json.JSONException; @@ -147,6 +148,11 @@ public class Contact implements ListItem, Blockable { return tags; } + @Override + public int getStatusColor() { + return Color.parseColor(UIHelper.getStatusColor(getMostAvailableStatus())); + } + public boolean match(String needle) { if (needle == null || needle.isEmpty()) { return true; diff --git a/src/main/java/de/thedevstack/conversationsplus/entities/ListItem.java b/src/main/java/de/thedevstack/conversationsplus/entities/ListItem.java index 825eb481..9daf90d1 100644 --- a/src/main/java/de/thedevstack/conversationsplus/entities/ListItem.java +++ b/src/main/java/de/thedevstack/conversationsplus/entities/ListItem.java @@ -11,6 +11,8 @@ public interface ListItem extends Comparable { public List getTags(); + public int getStatusColor(); + public final class Tag { private final String name; private final int color; -- cgit v1.2.3