From e701d03233b22621a3928b1726f41f2881758e7c Mon Sep 17 00:00:00 2001 From: aliveoutside <53598473+aliveoutside@users.noreply.github.com> Date: Fri, 29 Jul 2022 17:44:09 +0300 Subject: [PATCH] [accents] fix tinttextview --- .../java/ru/vtosters/lite/themes/hooks/TextViewHook.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/themes/hooks/TextViewHook.java b/app/src/main/java/ru/vtosters/lite/themes/hooks/TextViewHook.java index 034118d23..cf8eb0103 100644 --- a/app/src/main/java/ru/vtosters/lite/themes/hooks/TextViewHook.java +++ b/app/src/main/java/ru/vtosters/lite/themes/hooks/TextViewHook.java @@ -38,9 +38,10 @@ public class TextViewHook implements BaseHook { } if (view instanceof TintTextView) { - if (eligibleForStartTinting(view.getId())) { + if (eligibleForStartTinting((TintTextView) view)) { ((TintTextView) view).setDrawableStartTint(ThemesUtils.getAccentColor()); - } else if (eligibleForTinting(view.getId())) { + } + if (eligibleForTinting(view.getId())) { ((TintTextView) view).setDrawableTint(ThemesUtils.getAccentColor()); } } @@ -62,8 +63,8 @@ public class TextViewHook implements BaseHook { } } - public static boolean eligibleForStartTinting(int id) { - return !ThemesUtils.isDarkTheme() && id == com.vtosters.lite.R.id.post_retweet_name; + public static boolean eligibleForStartTinting(TintTextView view) { + return ThemesUtils.isAccentedColor(view.getTextColors()) || view.getTextColors().getDefaultColor() == ThemesUtils.getAccentColor(); } public static boolean eligibleForTinting(int id) {