[android] Add new custom switch for preference

Signed-off-by: jeanbaptisteC <jeanbaptiste.charron@outlook.fr>
This commit is contained in:
Jean-Baptiste
2025-08-22 18:35:06 +02:00
committed by Konstantin Pastbin
parent 9425138782
commit 4861ae7e67
2 changed files with 16 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Derived from https://github.com/androidx/androidx/blob/8cb282cc/preference/preference/res/layout/preference_widget_switch_compat.xml -->
<com.google.android.material.materialswitch.MaterialSwitch xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/switchWidget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@null"
android:clickable="false"
android:focusable="false" />

View File

@@ -379,4 +379,11 @@
<item name="android:textAllCaps">false</item>
</style>
<style name="MwmWidget.Preference">
<item name="switchPreferenceCompatStyle">@style/MwmWidget.SwitchPreferenceCompat</item>
</style>
<style name="MwmWidget.SwitchPreferenceCompat" parent="Preference.SwitchPreferenceCompat.Material">
<item name="android:widgetLayout">@layout/preference_switch</item>
</style>
</resources>