summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorebraminio <ebrahim@gnu.org>2023-05-29 15:15:25 +0330
committerGitHub <noreply@github.com>2023-05-29 13:45:25 +0200
commitd51e937e9651bcd5955055bee6abffcdefaa0c66 (patch)
tree290755bf29abd5fb820096db3cf6f341d3da37a2 /core/src
parent10c70dd5f1bd498de32e323cd2832e247df80db7 (diff)
downloadAntennaPod-d51e937e9651bcd5955055bee6abffcdefaa0c66.zip
Use the brand new material switches for preferences (#6475)
Diffstat (limited to 'core/src')
-rw-r--r--core/src/main/res/layout/preference_material_switch.xml10
-rw-r--r--core/src/main/res/values/styles.xml10
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>