Material 3 style switches in settings

This commit is contained in:
0xd9a 2025-07-23 21:49:52 +05:30
parent 7876f643c1
commit 23ab8c809a
3 changed files with 14 additions and 0 deletions

View file

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/switchWidget"
android:layout_width="match_parent"
android:layout_height="wrap_content" />

View file

@ -85,6 +85,7 @@
<item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item> <item name="android:windowLightNavigationBar" tools:targetApi="o_mr1">false</item>
<item name="android:isLightTheme" tools:targetApi="q">false</item> <item name="android:isLightTheme" tools:targetApi="q">false</item>
<item name="alertDialogTheme">@style/AppThemeAlertDialog</item> <item name="alertDialogTheme">@style/AppThemeAlertDialog</item>
<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
</style> </style>

View file

@ -84,6 +84,7 @@
<item name="android:isLightTheme" tools:targetApi="q">true</item> <item name="android:isLightTheme" tools:targetApi="q">true</item>
<item name="android:statusBarColor">?android:colorBackground</item> <item name="android:statusBarColor">?android:colorBackground</item>
<item name="alertDialogTheme">@style/AppThemeAlertDialog</item> <item name="alertDialogTheme">@style/AppThemeAlertDialog</item>
<item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item>
</style> </style>
<style name="Transparent" parent="AppThemeBar"> <style name="Transparent" parent="AppThemeBar">
@ -277,4 +278,11 @@
<item name="cornerSize">6dp</item> <item name="cornerSize">6dp</item>
</style> </style>
<style name="AppPreferenceThemeOverlay" parent="PreferenceThemeOverlay">
<item name="switchPreferenceCompatStyle">@style/AppSwitchPreferenceCompatStyle</item>
</style>
<style name="AppSwitchPreferenceCompatStyle" parent="@style/Preference.SwitchPreferenceCompat.Material">
<item name="widgetLayout">@layout/preference_switch_material</item>
</style>
</resources> </resources>