aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/de/thedevstack/conversationsplus/utils/ui/TextViewUtil.java13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/main/java/de/thedevstack/conversationsplus/utils/ui/TextViewUtil.java b/src/main/java/de/thedevstack/conversationsplus/utils/ui/TextViewUtil.java
index faa9a5ed..fefebdf0 100644
--- a/src/main/java/de/thedevstack/conversationsplus/utils/ui/TextViewUtil.java
+++ b/src/main/java/de/thedevstack/conversationsplus/utils/ui/TextViewUtil.java
@@ -1,5 +1,6 @@
package de.thedevstack.conversationsplus.utils.ui;
+import android.support.annotation.ColorRes;
import android.support.annotation.StringRes;
import android.view.View;
import android.widget.TextView;
@@ -58,12 +59,20 @@ public final class TextViewUtil extends ViewUtil {
}
public static void setColor(TextView tv, Integer color) {
- setColorEnabledAndTextResId(tv, color, null, null);
+ setColorByIdEnabledAndTextResId(tv, color, null, null);
+ }
+
+ private static void setColorByIdEnabledAndTextResId(TextView tv, @ColorRes Integer colorResId, Boolean enabled, @StringRes Integer resid) {
+ Integer color = null;
+ if (null != colorResId) {
+ color = ConversationsPlusColors.byId(colorResId);
+ }
+ setColorEnabledAndTextResId(tv, color, enabled, resid);
}
public static void setColorEnabledAndTextResId(TextView tv, Integer color, Boolean enabled, @StringRes Integer resid) {
if (null != color) {
- tv.setTextColor(ConversationsPlusColors.byId(color));
+ tv.setTextColor(color);
}
if (enabled != null) {