From 3f4721bbd9ee73b34ac9d50093fdf0c74ce06041 Mon Sep 17 00:00:00 2001 From: Harry Bond Date: Sun, 29 Dec 2024 17:51:33 +0000 Subject: [PATCH] set routing buttons colour with xml, not programatically Signed-off-by: Harry Bond --- .../organicmaps/widget/RoutingToolbarButton.java | 6 ++---- .../main/res/color/routing_toolbar_icon_tint.xml | 2 +- .../res/color/routing_toolbar_icon_tint_night.xml | 11 ----------- .../res/drawable/routing_toolbar_button_active.xml | 2 +- .../res/drawable/routing_toolbar_button_night.xml | 13 ------------- .../res/drawable/routing_toolbar_button_normal.xml | 2 +- .../routing_toolbar_button_normal_night.xml | 7 ------- .../app/src/main/res/values-night/themes-base.xml | 3 +++ android/app/src/main/res/values/themes-attrs.xml | 3 +++ android/app/src/main/res/values/themes-base.xml | 4 ++++ 10 files changed, 15 insertions(+), 38 deletions(-) delete mode 100644 android/app/src/main/res/color/routing_toolbar_icon_tint_night.xml delete mode 100644 android/app/src/main/res/drawable/routing_toolbar_button_night.xml delete mode 100644 android/app/src/main/res/drawable/routing_toolbar_button_normal_night.xml diff --git a/android/app/src/main/java/app/organicmaps/widget/RoutingToolbarButton.java b/android/app/src/main/java/app/organicmaps/widget/RoutingToolbarButton.java index cfad34db1f..00ba4381f6 100644 --- a/android/app/src/main/java/app/organicmaps/widget/RoutingToolbarButton.java +++ b/android/app/src/main/java/app/organicmaps/widget/RoutingToolbarButton.java @@ -37,10 +37,8 @@ public class RoutingToolbarButton extends AppCompatRadioButton private void initView() { - setBackgroundResource(ThemeUtils.isNightTheme(getContext()) ? R.drawable.routing_toolbar_button_night - : R.drawable.routing_toolbar_button); - setButtonTintList(ThemeUtils.isNightTheme(getContext()) ? R.color.routing_toolbar_icon_tint_night - : R.color.routing_toolbar_icon_tint); + setBackgroundResource(R.drawable.routing_toolbar_button); + setButtonTintList(R.color.routing_toolbar_icon_tint); } public void progress() diff --git a/android/app/src/main/res/color/routing_toolbar_icon_tint.xml b/android/app/src/main/res/color/routing_toolbar_icon_tint.xml index c324c3fdc0..0eb6cc00f4 100644 --- a/android/app/src/main/res/color/routing_toolbar_icon_tint.xml +++ b/android/app/src/main/res/color/routing_toolbar_icon_tint.xml @@ -2,7 +2,7 @@ + android:color="?routingToolbarButtonIconActive"/> diff --git a/android/app/src/main/res/color/routing_toolbar_icon_tint_night.xml b/android/app/src/main/res/color/routing_toolbar_icon_tint_night.xml deleted file mode 100644 index 883a8200a2..0000000000 --- a/android/app/src/main/res/color/routing_toolbar_icon_tint_night.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - diff --git a/android/app/src/main/res/drawable/routing_toolbar_button_active.xml b/android/app/src/main/res/drawable/routing_toolbar_button_active.xml index 1d422d4e2f..93f5580705 100644 --- a/android/app/src/main/res/drawable/routing_toolbar_button_active.xml +++ b/android/app/src/main/res/drawable/routing_toolbar_button_active.xml @@ -3,5 +3,5 @@ android:shape="oval" android:height="40dp" android:width="40dp"> - + diff --git a/android/app/src/main/res/drawable/routing_toolbar_button_night.xml b/android/app/src/main/res/drawable/routing_toolbar_button_night.xml deleted file mode 100644 index 0be952a4b4..0000000000 --- a/android/app/src/main/res/drawable/routing_toolbar_button_night.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - diff --git a/android/app/src/main/res/drawable/routing_toolbar_button_normal.xml b/android/app/src/main/res/drawable/routing_toolbar_button_normal.xml index ebfa6cbb6a..35a47fc6a0 100644 --- a/android/app/src/main/res/drawable/routing_toolbar_button_normal.xml +++ b/android/app/src/main/res/drawable/routing_toolbar_button_normal.xml @@ -3,5 +3,5 @@ android:shape="oval" android:height="40dp" android:width="40dp"> - + diff --git a/android/app/src/main/res/drawable/routing_toolbar_button_normal_night.xml b/android/app/src/main/res/drawable/routing_toolbar_button_normal_night.xml deleted file mode 100644 index 47906aacb4..0000000000 --- a/android/app/src/main/res/drawable/routing_toolbar_button_normal_night.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - diff --git a/android/app/src/main/res/values-night/themes-base.xml b/android/app/src/main/res/values-night/themes-base.xml index 968b7f479e..11d4d6eb76 100644 --- a/android/app/src/main/res/values-night/themes-base.xml +++ b/android/app/src/main/res/values-night/themes-base.xml @@ -81,6 +81,9 @@ @style/MwmTheme.Navigation @color/routing_button_tint + @color/routing_button_activated_tint_night + @color/routing_button_tint + @color/bg_primary_dark_night @drawable/list_divider_night diff --git a/android/app/src/main/res/values/themes-attrs.xml b/android/app/src/main/res/values/themes-attrs.xml index 4c13463cda..d8ee76d584 100644 --- a/android/app/src/main/res/values/themes-attrs.xml +++ b/android/app/src/main/res/values/themes-attrs.xml @@ -43,6 +43,9 @@ + + + diff --git a/android/app/src/main/res/values/themes-base.xml b/android/app/src/main/res/values/themes-base.xml index 8f0945efca..6ae504024b 100644 --- a/android/app/src/main/res/values/themes-base.xml +++ b/android/app/src/main/res/values/themes-base.xml @@ -79,6 +79,10 @@ @style/MwmTheme.Navigation @color/routing_button_tint + @color/routing_button_activated_tint + @color/routing_button_tint + @color/bg_primary_dark + @style/PreferenceThemeOverlay.v14.Material