Skip to content

Commit

Permalink
Use MD3 switches in settings
Browse files Browse the repository at this point in the history
  • Loading branch information
grote committed Jun 24, 2024
1 parent 73e9b60 commit 59b94c3
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
8 changes: 8 additions & 0 deletions app/src/main/res/layout/preference_switch.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?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"
android:background="@null"
android:clickable="false"
android:focusable="false" />
6 changes: 5 additions & 1 deletion app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
SPDX-FileCopyrightText: 2020 The Calyx Institute
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">

<style name="AppTheme" parent="@style/Theme.Material3.DayNight.NoActionBar">
<item name="colorPrimary">@color/accent_primary</item>
Expand Down Expand Up @@ -100,4 +100,8 @@
<item name="android:minHeight">56dp</item>
<item name="textAllCaps">false</item>
</style>

<style name="Preference.SwitchPreferenceCompat" parent="@style/Preference.SwitchPreferenceCompat.Material" tools:ignore="ResourceCycle">
<item name="widgetLayout">@layout/preference_switch</item>
</style>
</resources>

0 comments on commit 59b94c3

Please sign in to comment.