fixed polls colors
This commit is contained in:
@@ -3,9 +3,11 @@ package ru.vtosters.lite.themes.utils;
|
||||
import android.annotation.SuppressLint;
|
||||
import android.content.Context;
|
||||
import android.content.res.ColorStateList;
|
||||
import android.content.res.TypedArray;
|
||||
import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import android.widget.TextView;
|
||||
import com.vk.core.drawable.RecoloredDrawable;
|
||||
import ru.vtosters.lite.R;
|
||||
import ru.vtosters.lite.themes.ColorReferences;
|
||||
@@ -31,6 +33,16 @@ public class RecolorUtils {
|
||||
return recolorDrawable(drawable, ThemesUtils.isDarkTheme() ? ThemesUtils.getColor(com.vtosters.lite.R.color.gray_100) : ThemesUtils.getColorFromAttr(com.vtosters.lite.R.attr.header_tint));
|
||||
}
|
||||
|
||||
public static int getColor(TypedArray ta, int index, int defval) {
|
||||
return recolorHexColor(ta.getColor(index, defval));
|
||||
}
|
||||
|
||||
public static void recolorTextView(TextView tw) {
|
||||
if (ColorReferences.isAccentedColor(tw.getTextColors())) {
|
||||
tw.setTextColor(ThemesUtils.getAccentColor());
|
||||
}
|
||||
}
|
||||
|
||||
public static int recolorHexColor(int i) {
|
||||
if (!ThemesUtils.isCustomAccentEnabled()) return i;
|
||||
var accented = ColorReferences.isAccentedColor(i);
|
||||
|
||||
@@ -95,6 +95,8 @@
|
||||
|
||||
invoke-virtual {v0, v1}, Landroid/widget/TextView;->setOnClickListener(Landroid/view/View$OnClickListener;)V
|
||||
|
||||
invoke-static {v0}, Lru/vtosters/lite/themes/utils/RecolorUtils;->recolorTextView(Landroid/widget/TextView;)V
|
||||
|
||||
return-void
|
||||
.end method
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@
|
||||
|
||||
check-cast v0, Landroid/widget/TextView;
|
||||
|
||||
invoke-static {v0}, Lru/vtosters/lite/themes/utils/RecolorUtils;->recolorTextView(Landroid/widget/TextView;)V
|
||||
|
||||
return-object v0
|
||||
.end method
|
||||
|
||||
|
||||
@@ -285,7 +285,7 @@
|
||||
move-result-object p0
|
||||
|
||||
.line 92
|
||||
invoke-virtual {p0, v2, v2}, Landroid/content/res/TypedArray;->getColor(II)I
|
||||
invoke-static {p0, v2, v2}, Lru/vtosters/lite/themes/utils/RecolorUtils;->getColor(Landroid/content/res/TypedArray;II)I
|
||||
|
||||
move-result p1
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
const/4 v0, 0x0
|
||||
|
||||
.line 5
|
||||
invoke-virtual {p1, v0, v0}, Landroid/content/res/TypedArray;->getColor(II)I
|
||||
invoke-static {p1, v0, v0}, Lru/vtosters/lite/themes/utils/RecolorUtils;->getColor(Landroid/content/res/TypedArray;II)I
|
||||
|
||||
move-result v1
|
||||
|
||||
@@ -115,10 +115,6 @@
|
||||
|
||||
sget-object v4, Landroid/graphics/PorterDuff$Mode;->SRC_IN:Landroid/graphics/PorterDuff$Mode;
|
||||
|
||||
invoke-static {v1}, Lru/vtosters/lite/themes/utils/RecolorUtils;->recolorHexColor(I)I
|
||||
|
||||
move-result v1
|
||||
|
||||
invoke-virtual {v3, v1, v4}, Landroid/graphics/drawable/Drawable;->setColorFilter(ILandroid/graphics/PorterDuff$Mode;)V
|
||||
|
||||
:cond_1
|
||||
|
||||
Reference in New Issue
Block a user