From 857db4879a880fe30b81a8c29fce21f474cf393a Mon Sep 17 00:00:00 2001 From: gdlbo <41114720+gdlbo@users.noreply.github.com> Date: Fri, 2 Feb 2024 14:27:35 +0300 Subject: [PATCH] vkui theming fixes thx @awers24 --- .../lite/utils/WebViewColoringUtils.java | 2 ++ smali/assets/vt_ui_accent.css | 19 +++++++++++++++++++ smali/assets/vt_ui_oled.css | 5 +++-- 3 files changed, 24 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/ru/vtosters/lite/utils/WebViewColoringUtils.java b/app/src/main/java/ru/vtosters/lite/utils/WebViewColoringUtils.java index f0533acb4..6052d0cda 100644 --- a/app/src/main/java/ru/vtosters/lite/utils/WebViewColoringUtils.java +++ b/app/src/main/java/ru/vtosters/lite/utils/WebViewColoringUtils.java @@ -24,6 +24,8 @@ public class WebViewColoringUtils { .replace("%button_primary_background%", hex(getColorFromAttr(com.vtosters.lite.R.attr.button_primary_background))) .replace("%button_outline_foreground%", hex(getColorFromAttr(com.vtosters.lite.R.attr.button_outline_foreground))) .replace("%button_outline_border%", hex(getColorFromAttr(com.vtosters.lite.R.attr.button_outline_border))) + .replace("%field_background%", hex(getColorFromAttr(com.vtosters.lite.R.attr.field_background))) + .replace("%field_border%", hex(getColorFromAttr(com.vtosters.lite.R.attr.field_border))) .replace("%text_primary%", hex(getTextAttr())); } catch (IOException e) { return ""; diff --git a/smali/assets/vt_ui_accent.css b/smali/assets/vt_ui_accent.css index dc581a1d2..e244f2691 100644 --- a/smali/assets/vt_ui_accent.css +++ b/smali/assets/vt_ui_accent.css @@ -8,6 +8,9 @@ .vkuibright_light, [scheme=bright_light], body[scheme=bright_light], .vkui--vkBase--light, .vkui--vkIOS--light, .vkui--vkCom--light { --accent: %accent% !important; + --color_text_accent: %accent% !important; + --vkui--color_text_accent: %accent% !important; + --vkui--color_stroke_accent: %accent% !important; --vkui--color_icon_accent: %accent% !important; --action_sheet_action_foreground: %accent% !important; --attach_picker_tab_active_background: %accent% !important; @@ -49,6 +52,8 @@ --vkui--color_background_content: %background_content% !important; --background_page: %background_page% !important; --vkui--color_background: %background_page% !important; + --color_background_modal: %background_content% !important; + --vkui--color_background_modal: %background_content% !important; --content_tint_background: %content_tint_background% !important; --vkui--color_background_secondary: %content_tint_background% !important; --loader_background: %background_page% !important; @@ -59,6 +64,10 @@ --vkui--color_header_background_before_blur: %header_background% !important; --vkui--color_header_background_before_blur_alternate: %header_background% !important; --header_alternate_background: %header_background% !important; + --color_field_border: %field_border% !important; + --vkui--color_field_border: %field_border% !important; + --color_field_background: %field_background% !important; + --vkui--color_field_background: %field_background% !important; --header_text_alternate: %header_text% !important; --header_text: %header_text% !important; @@ -72,6 +81,9 @@ .vkuispace_gray, [scheme=space_gray], body[scheme=space_gray], .vkui--vkBase--dark, .vkui--vkIOS--dark, .vkui--vkCom--dark { --accent: %accent% !important; + --color_text_accent: %accent% !important; + --vkui--color_text_accent: %accent% !important; + --vkui--color_stroke_accent: %accent% !important; --vkui--color_icon_accent: %accent% !important; --action_sheet_action_foreground: %accent% !important; --attach_picker_tab_active_background: %accent% !important; @@ -112,6 +124,8 @@ --vkui--color_background_content: %background_content% !important; --background_page: %background_page% !important; --vkui--color_background: %background_page% !important; + --color_background_modal: %background_content% !important; + --vkui--color_background_modal: %background_content% !important; --content_tint_background: %content_tint_background% !important; --vkui--color_background_secondary: %content_tint_background% !important; --loader_background: %background_page% !important; @@ -125,6 +139,11 @@ --header_tint: %header_text% !important; --header_tint_alternate: %header_text% !important; --vkui--color_icon_accent_themed: %header_text% !important; + --color_field_border: %field_border% !important; + --vkui--color_field_border: %field_border% !important; + --color_field_background: %field_background% !important; + --vkui--color_field_background: %field_background% !important; + --header_text_alternate: %header_text% !important; --header_text: %header_text% !important; --header_text_secondary: %header_text% !important; diff --git a/smali/assets/vt_ui_oled.css b/smali/assets/vt_ui_oled.css index 9415ccacb..c0e093157 100644 --- a/smali/assets/vt_ui_oled.css +++ b/smali/assets/vt_ui_oled.css @@ -63,7 +63,6 @@ body.article_body.article_dark { --overlay_status_background: #000000 !important; --header_background: #000000 !important; --header_alternate_background: #000000 !important; - --header_alternate_background: #000000 !important; --vkui--color_header_background: #000000 !important; --separator_alternate: #000000 !important; --segmented_control_bar_background: #000000 !important; @@ -83,7 +82,6 @@ body.article_body.article_dark { --field_background: #121212 !important; --im_bubble_incoming: #121212 !important; --input_border: #121212 !important; - --vkui--color_write_bar_input_background: #121212 !important; --modal_card_background: #121212 !important; --separator_common: #121212 !important; --vkui--color_separator_primary: #121212 !important; @@ -105,4 +103,7 @@ body.article_body.article_dark { --vkui--color_search_field_background: #212121 !important; --selection_off_icon: #212121 !important; --panel_tab_active_background: #212121 !important; + --color_background_modal: #000000 !important; + --color_field_background: #212121 !important; + --vkui--color_field_background: #212121 !important; }