Migrate to MaterialSwitch component
This commit is contained in:
@@ -68,7 +68,7 @@
|
||||
|
||||
</com.google.android.material.textfield.TextInputLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_tracker"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
android:paddingStart="?listPreferredItemPaddingStart"
|
||||
android:paddingEnd="?listPreferredItemPaddingEnd">
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_local"
|
||||
android:layout_width="0dp"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
|
||||
</LinearLayout>
|
||||
|
||||
<com.google.android.material.switchmaterial.SwitchMaterial
|
||||
<com.google.android.material.materialswitch.MaterialSwitch
|
||||
android:id="@+id/switch_toggle"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content" />
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
<?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" />
|
||||
@@ -2,5 +2,4 @@
|
||||
<resources>
|
||||
<bool name="light_status_bar">false</bool>
|
||||
<bool name="light_navigation_bar">false</bool>
|
||||
<bool name="elevation_overlay_enabled">true</bool>
|
||||
</resources>
|
||||
@@ -1,11 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources>
|
||||
|
||||
<style name="Widget.Kotatsu.Switch" parent="Widget.Material3.CompoundButton.Switch">
|
||||
<item name="android:thumb">@drawable/switch_thumb</item>
|
||||
<item name="thumbTint">@color/selector_switch_thumb</item>
|
||||
<item name="track">@drawable/switch_track</item>
|
||||
<item name="trackTint">@color/selector_switch_track</item>
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.Kotatsu.Switch</item>
|
||||
</style>
|
||||
</resources>
|
||||
@@ -3,5 +3,4 @@
|
||||
<bool name="is_tablet">false</bool>
|
||||
<bool name="light_status_bar">true</bool>
|
||||
<bool name="light_navigation_bar">false</bool>
|
||||
<bool name="elevation_overlay_enabled">false</bool>
|
||||
</resources>
|
||||
@@ -86,13 +86,6 @@
|
||||
<item name="iconPadding">16dp</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Kotatsu.Switch" parent="Widget.Material3.CompoundButton.Switch">
|
||||
<item name="android:thumb">@drawable/switch_thumb</item>
|
||||
<item name="track">@drawable/switch_track</item>
|
||||
<item name="useMaterialThemeColors">false</item>
|
||||
<item name="materialThemeOverlay">@style/ThemeOverlay.Kotatsu.Switch</item>
|
||||
</style>
|
||||
|
||||
<style name="Widget.Kotatsu.RecyclerView" parent="">
|
||||
<item name="fastScrollHorizontalThumbDrawable">@drawable/list_thumb</item>
|
||||
<item name="fastScrollVerticalThumbDrawable">@drawable/list_thumb</item>
|
||||
@@ -113,10 +106,6 @@
|
||||
<item name="android:insetBottom">2dp</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.Kotatsu.Switch" parent="">
|
||||
<item name="elevationOverlayEnabled">@bool/elevation_overlay_enabled</item>
|
||||
</style>
|
||||
|
||||
<style name="ThemeOverlay.Kotatsu.MainToolbar" parent="">
|
||||
<item name="colorControlHighlight">@color/selector_overlay</item>
|
||||
</style>
|
||||
@@ -180,4 +169,8 @@
|
||||
<item name="android:dialogLayout">@layout/preference_dialog_autocompletetextview</item>
|
||||
</style>
|
||||
|
||||
<style name="Preference.SwitchPreferenceCompat.M3" parent="Preference.SwitchPreferenceCompat.Material">
|
||||
<item name="android:widgetLayout">@layout/preference_widget_material_switch</item>
|
||||
</style>
|
||||
|
||||
</resources>
|
||||
|
||||
@@ -68,11 +68,11 @@
|
||||
<item name="toolbarStyle">@style/Widget.Material3.Toolbar</item>
|
||||
<item name="appBarLayoutStyle">@style/Widget.Material3.AppBarLayout</item>
|
||||
<item name="tabStyle">@style/Widget.Kotatsu.Tabs</item>
|
||||
<item name="switchStyle">@style/Widget.Kotatsu.Switch</item>
|
||||
<item name="materialCardViewStyle">@style/Widget.Material3.CardView.Filled</item>
|
||||
<item name="recyclerViewStyle">@style/Widget.Kotatsu.RecyclerView</item>
|
||||
<item name="listItemTextViewStyle">@style/Widget.Kotatsu.ListItemTextView</item>
|
||||
<item name="materialSwitchStyle">@style/Widget.Material3.CompoundButton.MaterialSwitch</item>
|
||||
<item name="switchPreferenceCompatStyle">@style/Preference.SwitchPreferenceCompat.M3</item>
|
||||
|
||||
<!-- Text appearance -->
|
||||
<item name="actionMenuTextAppearance">@style/TextAppearance.Kotatsu.Menu</item>
|
||||
|
||||
Reference in New Issue
Block a user