mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-26 13:44:18 +01:00
Override the default PreferenceScreen
divider with an MD3 one
This commit is contained in:
parent
b12a2bdc3e
commit
6fcb09bd2d
11
app/src/main/res/drawable/preference_list_divider_m3.xml
Normal file
11
app/src/main/res/drawable/preference_list_divider_m3.xml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?xml version="1.0" encoding="utf-8"?><!-- Material Divider for PreferenceScreen -->
|
||||||
|
<layer-list xmlns:android="http://schemas.android.com/apk/res/android">
|
||||||
|
<item>
|
||||||
|
<shape>
|
||||||
|
<solid android:color="?attr/colorOutlineVariant" />
|
||||||
|
<size
|
||||||
|
android:width="1dp"
|
||||||
|
android:height="1dp" />
|
||||||
|
</shape>
|
||||||
|
</item>
|
||||||
|
</layer-list>
|
@ -16,4 +16,9 @@
|
|||||||
<style name="App.Preference.SwitchPreferenceCompat.Material3" parent="Preference.SwitchPreferenceCompat.Material">
|
<style name="App.Preference.SwitchPreferenceCompat.Material3" parent="Preference.SwitchPreferenceCompat.Material">
|
||||||
<item name="android:widgetLayout">@layout/preference_widget_material_switch</item>
|
<item name="android:widgetLayout">@layout/preference_widget_material_switch</item>
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
|
<!-- Override the default divider used in PreferenceScreen -->
|
||||||
|
<style name="App.PreferenceFragment.Material" parent="PreferenceFragment.Material">
|
||||||
|
<item name="android:divider">@drawable/preference_list_divider_m3</item>
|
||||||
|
</style>
|
||||||
</resources>
|
</resources>
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
<item name="alertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item>
|
<item name="alertDialogTheme">@style/ThemeOverlay.App.MaterialAlertDialog</item>
|
||||||
<!-- Workaround for AndroidX PreferenceScreen since it uses colorAccent as categories text color -->
|
<!-- Workaround for AndroidX PreferenceScreen since it uses colorAccent as categories text color -->
|
||||||
<item name="colorAccent">?attr/colorPrimary</item>
|
<item name="colorAccent">?attr/colorPrimary</item>
|
||||||
|
<!-- Override the default divider used in PreferenceScreen -->
|
||||||
|
<item name="preferenceFragmentCompatStyle">@style/App.PreferenceFragment.Material</item>
|
||||||
<!-- Override the default switch preference style to use the MD3 switch -->
|
<!-- Override the default switch preference style to use the MD3 switch -->
|
||||||
<item name="switchPreferenceCompatStyle">@style/App.Preference.SwitchPreferenceCompat.Material3</item>
|
<item name="switchPreferenceCompatStyle">@style/App.Preference.SwitchPreferenceCompat.Material3</item>
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
Reference in New Issue
Block a user