diff options
author | Ricki Hirner <hirner@bitfire.at> | 2022-10-11 11:41:39 +0300 |
---|---|---|
committer | Ricki Hirner <hirner@bitfire.at> | 2022-10-11 13:48:16 +0300 |
commit | e14460111e9020189b69ece5c433c6386285b44c (patch) | |
tree | df1623fed789f7084933a753110c946f54a294e1 | |
parent | 31fb7ec190c67f95ab78a05802b26f7377817d46 (diff) |
Use Material switches for preferences
-rw-r--r-- | app/src/main/res/layout/view_preference_switch.xml | 5 | ||||
-rw-r--r-- | app/src/main/res/values/styles.xml | 6 |
2 files changed, 11 insertions, 0 deletions
diff --git a/app/src/main/res/layout/view_preference_switch.xml b/app/src/main/res/layout/view_preference_switch.xml new file mode 100644 index 00000000..10733b78 --- /dev/null +++ b/app/src/main/res/layout/view_preference_switch.xml @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="utf-8"?> +<com.google.android.material.switchmaterial.SwitchMaterial xmlns:android="http://schemas.android.com/apk/res/android" + android:id="@+id/switchWidget" + android:layout_width="wrap_content" + android:layout_height="wrap_content" />
\ No newline at end of file diff --git a/app/src/main/res/values/styles.xml b/app/src/main/res/values/styles.xml index b0d9e9e4..fe7350c4 100644 --- a/app/src/main/res/values/styles.xml +++ b/app/src/main/res/values/styles.xml @@ -55,6 +55,8 @@ <item name="android:textColorSecondary">@color/secondaryTextColor</item> <item name="android:colorBackground">@color/backgroundColor</item> + + <item name="switchPreferenceCompatStyle">@style/MySwitchPreference</item> </style> <style name="AppTheme.NoActionBar"> @@ -81,4 +83,8 @@ <color name="cardview_background">@color/secondaryLightColor</color> + <style name="MySwitchPreference" parent="@style/Preference.SwitchPreferenceCompat.Material"> + <item name="widgetLayout">@layout/view_preference_switch</item> + </style> + </resources> |