From 9599b54329d0dbd7b9c69146af99caf90f15b9d7 Mon Sep 17 00:00:00 2001 From: steckbrief Date: Sun, 11 Jun 2017 13:55:45 +0200 Subject: Fix wrong id for setColorColorAndText --- .../conversationsplus/utils/ui/TextViewUtil.java | 13 +++++++++++-- 1 file 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) { -- cgit v1.2.3