Apply Material 3 design to preference switch

This commit is contained in:
Niko Diamadis
2023-02-13 12:30:09 +01:00
parent ddd902e17e
commit aea9c0c346
2 changed files with 11 additions and 1 deletions

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<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" />

View File

@@ -1,4 +1,4 @@
<resources> <resources xmlns:tools="http://schemas.android.com/tools">
<!-- Base application theme. --> <!-- Base application theme. -->
<style name="AppTheme" parent="Theme.Material3.DayNight"> <style name="AppTheme" parent="Theme.Material3.DayNight">
@@ -25,4 +25,8 @@
<style name="AppTheme.PopupOverlay" parent="AppTheme" /> <style name="AppTheme.PopupOverlay" parent="AppTheme" />
<style name="Preference.SwitchPreferenceCompat" parent="@style/Preference.SwitchPreferenceCompat.Material" tools:ignore="ResourceCycle">
<item name="widgetLayout">@layout/preference_switch</item>
</style>
</resources> </resources>