fix action menu icons color
This commit is contained in:
@@ -7,6 +7,7 @@ import android.graphics.Color;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
import com.vk.core.drawable.RecoloredDrawable;
|
||||
import ru.vtosters.lite.R;
|
||||
import ru.vtosters.lite.themes.ColorReferences;
|
||||
import ru.vtosters.lite.utils.AndroidUtils;
|
||||
import ru.vtosters.lite.utils.ThemesUtils;
|
||||
@@ -18,13 +19,18 @@ public class RecolorUtils {
|
||||
return new RecoloredDrawable(drawable, ThemesUtils.getHeaderText());
|
||||
} // Recolor toolbar drawable to accent color
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables")
|
||||
public static Drawable recolorDrawableInt(int drawable) {
|
||||
|
||||
@SuppressLint("UseCompatLoadingForDrawables") Drawable res = AndroidUtils.getResources().getDrawable(drawable);
|
||||
return new RecoloredDrawable(res, ThemesUtils.getAccentColor());
|
||||
return recolorDrawable(drawable, ThemesUtils.getAccentColor());
|
||||
} // Get res drawable via id and coloring to accent
|
||||
|
||||
public static Drawable recolorDrawable(int drawable, int color) {
|
||||
return new RecoloredDrawable(AndroidUtils.getResources().getDrawable(drawable), color);
|
||||
} // Get res drawable via id and coloring to accent
|
||||
|
||||
public static Drawable fixActionMenuIcons(int drawable) {
|
||||
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 recolorHexColor(int i) {
|
||||
if (!ThemesUtils.isCustomAccentEnabled()) return i;
|
||||
var accented = ColorReferences.isAccentedColor(i);
|
||||
|
||||
@@ -92,6 +92,10 @@
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
invoke-static {p2}, Lru/vtosters/lite/themes/utils/RecolorUtils;->recolorHexColor(I)I
|
||||
|
||||
move-result p2
|
||||
|
||||
.line 9
|
||||
invoke-static {p0, p1}, Lcom/vk/core/util/ContextExtKt;->c(Landroid/content/Context;I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
|
||||
@@ -104,16 +104,7 @@
|
||||
.end annotation
|
||||
.end param
|
||||
|
||||
.line 40
|
||||
iget-object v0, p0, Lcom/vk/ui/photoviewer/MenuController;->f:Landroid/app/Activity;
|
||||
|
||||
const v1, 0x7f040230
|
||||
|
||||
invoke-static {v1}, Lcom/vk/core/ui/themes/VKThemeHelper;->g(I)I
|
||||
|
||||
move-result v1
|
||||
|
||||
invoke-static {v0, p1, v1}, Lcom/vk/core/util/ContextExtKt;->b(Landroid/content/Context;II)Landroid/graphics/drawable/Drawable;
|
||||
invoke-static {p1}, Lru/vtosters/lite/themes/utils/RecolorUtils;->fixActionMenuIcons(I)Landroid/graphics/drawable/Drawable;
|
||||
|
||||
move-result-object p1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user