From bba51736160e86897d84b41630c9c14526b3ec57 Mon Sep 17 00:00:00 2001 From: Jean-Baptiste Date: Sat, 20 Dec 2025 14:54:21 +0100 Subject: [PATCH] [android] Use M3 background in dark mode Signed-off-by: Jean-Baptiste --- .../app/organicmaps/settings/BaseXmlSettingsFragment.java | 3 --- .../app/src/main/res/layout-w1020dp/activity_settings.xml | 6 ++++-- android/app/src/main/res/layout/activity_settings.xml | 3 ++- android/app/src/main/res/layout/dialog_missed_map.xml | 2 +- android/app/src/main/res/layout/dialog_missed_maps.xml | 2 +- android/app/src/main/res/layout/fragment_bookmark_list.xml | 3 ++- android/app/src/main/res/layout/fragment_categories.xml | 3 ++- android/app/src/main/res/layout/fragment_editor_host.xml | 3 ++- android/app/src/main/res/layout/fragment_timetable.xml | 2 +- .../app/src/main/res/layout/fragment_timetable_advanced.xml | 2 +- .../app/src/main/res/layout/fragment_timetable_simple.xml | 2 +- android/app/src/main/res/layout/item_category_title.xml | 2 +- android/app/src/main/res/layout/place_page_map_too_old.xml | 2 +- .../app/src/main/res/layout/place_page_phone_fragment.xml | 2 +- android/app/src/main/res/values-night/themes.xml | 2 +- 15 files changed, 21 insertions(+), 18 deletions(-) diff --git a/android/app/src/main/java/app/organicmaps/settings/BaseXmlSettingsFragment.java b/android/app/src/main/java/app/organicmaps/settings/BaseXmlSettingsFragment.java index 3961d2218..37da56f34 100644 --- a/android/app/src/main/java/app/organicmaps/settings/BaseXmlSettingsFragment.java +++ b/android/app/src/main/java/app/organicmaps/settings/BaseXmlSettingsFragment.java @@ -6,12 +6,10 @@ import android.view.View; import androidx.annotation.NonNull; import androidx.annotation.Nullable; import androidx.annotation.XmlRes; -import androidx.core.content.ContextCompat; import androidx.core.view.ViewCompat; import androidx.preference.Preference; import androidx.preference.PreferenceFragmentCompat; import androidx.recyclerview.widget.RecyclerView; -import app.organicmaps.R; import app.organicmaps.util.Utils; import app.organicmaps.util.WindowInsetUtils.ScrollableContentInsetsListener; @@ -44,7 +42,6 @@ abstract class BaseXmlSettingsFragment extends PreferenceFragmentCompat public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); - view.setBackgroundColor(ContextCompat.getColor(requireContext(), R.color.bg_cards)); RecyclerView recyclerView = getListView(); ViewCompat.setOnApplyWindowInsetsListener(recyclerView, new ScrollableContentInsetsListener(recyclerView)); } diff --git a/android/app/src/main/res/layout-w1020dp/activity_settings.xml b/android/app/src/main/res/layout-w1020dp/activity_settings.xml index 478cd6543..3919e63b3 100644 --- a/android/app/src/main/res/layout-w1020dp/activity_settings.xml +++ b/android/app/src/main/res/layout-w1020dp/activity_settings.xml @@ -3,7 +3,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> + android:orientation="vertical" + android:background="?cardBackground"> @@ -17,7 +18,8 @@ android:id="@+id/fragment_container" style="@style/MwmWidget.FrameLayout.Elevation" android:layout_width="match_parent" - android:layout_height="match_parent"/> + android:layout_height="match_parent" + android:background="?cardBackground"/> diff --git a/android/app/src/main/res/layout/activity_settings.xml b/android/app/src/main/res/layout/activity_settings.xml index 4df7f04a2..bd84fd307 100644 --- a/android/app/src/main/res/layout/activity_settings.xml +++ b/android/app/src/main/res/layout/activity_settings.xml @@ -3,7 +3,8 @@ xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" - android:orientation="vertical"> + android:orientation="vertical" + android:background="?cardBackground"> diff --git a/android/app/src/main/res/layout/dialog_missed_map.xml b/android/app/src/main/res/layout/dialog_missed_map.xml index 4214804b9..68dfd3678 100644 --- a/android/app/src/main/res/layout/dialog_missed_map.xml +++ b/android/app/src/main/res/layout/dialog_missed_map.xml @@ -24,7 +24,7 @@ android:id="@+id/items_frame" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?windowBackgroundForced"> + android:background="?cardBackground"> diff --git a/android/app/src/main/res/layout/fragment_bookmark_list.xml b/android/app/src/main/res/layout/fragment_bookmark_list.xml index bce10f52e..ca7357f1f 100644 --- a/android/app/src/main/res/layout/fragment_bookmark_list.xml +++ b/android/app/src/main/res/layout/fragment_bookmark_list.xml @@ -4,7 +4,8 @@ xmlns:tools="http://schemas.android.com/tools" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" - android:layout_height="match_parent"> + android:layout_height="match_parent" + android:background="?cardBackground"> + android:orientation="vertical" + android:background="?cardBackground"> + android:orientation="vertical" + android:background="?cardBackground"> diff --git a/android/app/src/main/res/layout/fragment_timetable_advanced.xml b/android/app/src/main/res/layout/fragment_timetable_advanced.xml index b96765d76..868066cc3 100644 --- a/android/app/src/main/res/layout/fragment_timetable_advanced.xml +++ b/android/app/src/main/res/layout/fragment_timetable_advanced.xml @@ -5,7 +5,7 @@ xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" - android:background="?windowBackgroundForced"> + android:background="?cardBackground"> diff --git a/android/app/src/main/res/layout/item_category_title.xml b/android/app/src/main/res/layout/item_category_title.xml index 0f98b8e5f..243573dfb 100644 --- a/android/app/src/main/res/layout/item_category_title.xml +++ b/android/app/src/main/res/layout/item_category_title.xml @@ -5,7 +5,7 @@ style="@style/TextAppearance.Headline6" android:layout_width="match_parent" android:layout_height="wrap_content" - android:background="?windowBackgroundForced" + android:background="?cardBackground" android:gravity="start|center_vertical" android:paddingStart="@dimen/margin_base" android:paddingTop="@dimen/margin_base_plus" diff --git a/android/app/src/main/res/layout/place_page_map_too_old.xml b/android/app/src/main/res/layout/place_page_map_too_old.xml index fb41ed5cc..61b4e3d20 100644 --- a/android/app/src/main/res/layout/place_page_map_too_old.xml +++ b/android/app/src/main/res/layout/place_page_map_too_old.xml @@ -9,7 +9,7 @@ android:layout_marginHorizontal="@dimen/margin_base" android:layout_marginTop="@dimen/margin_half" app:strokeWidth="1dp" app:strokeColor="@color/base_accent" -app:cardBackgroundColor="@color/bg_cards"> +app:cardBackgroundColor="?cardBackground"> \ No newline at end of file diff --git a/android/app/src/main/res/values-night/themes.xml b/android/app/src/main/res/values-night/themes.xml index fa0b8edad..203cfec53 100644 --- a/android/app/src/main/res/values-night/themes.xml +++ b/android/app/src/main/res/values-night/themes.xml @@ -23,7 +23,7 @@ @style/MwmTheme.AlertDialog @color/bg_window - @color/bg_cards + ?android:attr/colorBackground @color/white_primary @color/white_secondary @style/MwmTheme.DialogFragment.Fullscreen