[android] Use M3 background in dark mode

Signed-off-by: Jean-Baptiste <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-12-20 14:54:21 +01:00
parent 0eafe3482e
commit faa5e28ec0
3 changed files with 3 additions and 6 deletions

View File

@@ -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));
}

View File

@@ -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">
<LinearLayout
android:layout_width="match_parent"

View File

@@ -23,7 +23,7 @@
<item name="alertDialogTheme">@style/MwmTheme.AlertDialog</item>
<item name="windowBackgroundForced">@color/bg_window</item>
<item name="cardBackground">@color/bg_cards</item>
<item name="cardBackground">?android:attr/colorBackground</item>
<item name="titleDialogTheme">@color/white_primary</item>
<item name="textDialogTheme">@color/white_secondary</item>
<item name="fullscreenDialogTheme">@style/MwmTheme.DialogFragment.Fullscreen</item>
@@ -42,7 +42,7 @@
<item name="secondary">@color/text_light_hint</item>
<item name="dividerHorizontal">@color/divider</item>
<item name="ppBackground">@color/bg_cards</item>
<item name="ppBackground">?cardBackground</item>
<item name="ppButtonsBackground">@color/bg_window</item>
<item name="ppFloatingMarkerIconColor">@color/white_54</item>