diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/src/main/res/layout/preference_material_switch.xml | 10 | ||||
-rw-r--r-- | core/src/main/res/values/styles.xml | 10 |
2 files changed, 20 insertions, 0 deletions
diff --git a/core/src/main/res/layout/preference_material_switch.xml b/core/src/main/res/layout/preference_material_switch.xml new file mode 100644 index 000000000..b39e6b00f --- /dev/null +++ b/core/src/main/res/layout/preference_material_switch.xml @@ -0,0 +1,10 @@ +<?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" /> diff --git a/core/src/main/res/values/styles.xml b/core/src/main/res/values/styles.xml index 0ebf2aaf7..f1dcd3200 100644 --- a/core/src/main/res/values/styles.xml +++ b/core/src/main/res/values/styles.xml @@ -27,6 +27,7 @@ <item name="android:splitMotionEvents">false</item> <item name="android:fitsSystemWindows">false</item> <item name="android:windowContentTransitions">true</item> + <item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item> </style> <style name="Theme.AntennaPod.Light" parent="Theme.AntennaPod.Dynamic.Light"> @@ -68,6 +69,7 @@ <item name="android:windowLightStatusBar" tools:targetApi="m">false</item> <item name="android:windowContentTransitions">true</item> <item name="android:navigationBarColor">@color/background_darktheme</item> + <item name="preferenceTheme">@style/AppPreferenceThemeOverlay</item> </style> <style name="Theme.AntennaPod.Dark" parent="Theme.AntennaPod.Dynamic.Dark"> @@ -299,4 +301,12 @@ <item name="android:paddingEnd">8dp</item> </style> + <style name="AppPreferenceThemeOverlay" parent="@style/PreferenceThemeOverlay"> + <item name="switchPreferenceCompatStyle">@style/AppSwitchPreference</item> + </style> + + <style name="AppSwitchPreference" parent="@style/Preference.SwitchPreferenceCompat.Material"> + <item name="widgetLayout">@layout/preference_material_switch</item> + </style> + </resources> |