Refactored vkui injector + added headers coloring

This commit is contained in:
gdlbo
2022-04-25 15:51:07 +03:00
parent 07a070a4fe
commit 1b14761e9e
3 changed files with 60 additions and 11 deletions
@@ -30,6 +30,10 @@ public class Themes {
return VKThemeHelper.a((int) R.attr.tabbar_background);
}
public static int getHeaderBackground() {
return VKThemeHelper.a((int) R.attr.header_background);
}
public static int getAmoledTheme() {
return Helper.GetContext().getResources().getIdentifier("BaseAmoledStyle", "style", Helper.GetContext().getPackageName());
}
@@ -44,7 +44,10 @@ public class VKUIInjector {
public static void load() {
loadedCSS = load("vt_ui_accent.css")
.replace("%accent%", Themes.hex(Themes.getAccentColor()))
.replace("%header_background%", Themes.hex(Themes.getColorFromAttr(R.attr.header_background)))
.replace("%background_content%", Themes.hex(Themes.getColorFromAttr(R.attr.background_content)))
.replace("%header_text%", Themes.hex(Themes.getColorFromAttr(R.attr.header_text)))
.replace("%accent%", Themes.hex(Themes.getColorFromAttr(R.attr.accent)))
.replace("%background_page%", Themes.hex(Themes.getColorFromAttr(R.attr.background_page)))
.replace("%background_content%", Themes.hex(Themes.getColorFromAttr(R.attr.background_content)))
.replace("%text_primary%", Themes.hex(Themes.getColorFromAttr(R.attr.text_primary)));