mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-31 14:27:57 +01:00 
			
		
		
		
	Use Material3 switches in XML layouts
(cherry picked from commit da7a64b40d)
			
			
This commit is contained in:
		| @@ -17,7 +17,7 @@ | ||||
|         app:tint="?attr/colorOnBackground" /> | ||||
|  | ||||
|     <!-- Matches ID used in SwitchPreferenceCompat --> | ||||
|     <androidx.appcompat.widget.SwitchCompat | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/switchWidget" | ||||
|         android:layout_width="wrap_content" | ||||
|         android:layout_height="wrap_content" /> | ||||
|   | ||||
| @@ -1,5 +1,5 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <com.google.android.material.switchmaterial.SwitchMaterial | ||||
| <com.google.android.material.materialswitch.MaterialSwitch | ||||
|     xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     android:id="@+id/switchWidget" | ||||
|     android:layout_width="wrap_content" | ||||
|   | ||||
| @@ -11,12 +11,12 @@ | ||||
|  | ||||
|         <!-- Brightness --> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/custom_brightness" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_custom_brightness" | ||||
|             app:layout_constraintTop_toTopOf="parent" /> | ||||
|  | ||||
| @@ -61,12 +61,12 @@ | ||||
|  | ||||
|         <!-- Color filter --> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/switch_color_filter" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_custom_color_filter" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
| @@ -237,22 +237,22 @@ | ||||
|  | ||||
|         <!-- Grayscale --> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/grayscale" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_grayscale" | ||||
|             android:textColor="?android:attr/textColorSecondary" | ||||
|             app:layout_constraintTop_toBottomOf="@id/color_filter_mode" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/inverted_colors" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_inverted_colors" | ||||
|             android:textColor="?android:attr/textColorSecondary" | ||||
|             app:layout_constraintTop_toBottomOf="@id/grayscale" /> | ||||
|   | ||||
| @@ -17,68 +17,68 @@ | ||||
|             android:entries="@array/reader_themes" | ||||
|             app:title="@string/pref_reader_theme" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/show_page_number" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_show_page_number" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/fullscreen" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_fullscreen" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/cutout_short" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_cutout_short" | ||||
|             android:textColor="?android:attr/textColorSecondary" | ||||
|             android:visibility="gone" | ||||
|             tools:visibility="visible" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/keepscreen" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_keep_screen_on" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/long_tap" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_read_with_long_tap" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/always_show_chapter_transition" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_always_show_chapter_transition" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|         <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/page_transitions" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:paddingEnd="16dp" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_page_transitions" | ||||
|             android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|   | ||||
| @@ -37,12 +37,12 @@ | ||||
|         android:entries="@array/image_scale_type" | ||||
|         app:title="@string/pref_image_scale_type" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/landscape_zoom" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_landscape_zoom" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
| @@ -53,39 +53,39 @@ | ||||
|         android:entries="@array/zoom_start" | ||||
|         app:title="@string/pref_zoom_start" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/crop_borders" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_crop_borders" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/navigate_pan" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_navigate_pan" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/dual_page_split" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_dual_page_split" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/dual_page_invert" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_dual_page_invert" | ||||
|         android:textColor="?android:attr/textColorSecondary" | ||||
|         android:visibility="gone" | ||||
|   | ||||
| @@ -37,30 +37,30 @@ | ||||
|         android:entries="@array/webtoon_side_padding" | ||||
|         app:title="@string/pref_webtoon_side_padding" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/crop_borders_webtoon" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_crop_borders" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/dual_page_split" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_dual_page_split" | ||||
|         android:textColor="?android:attr/textColorSecondary" /> | ||||
|  | ||||
|     <com.google.android.material.switchmaterial.SwitchMaterial | ||||
|     <com.google.android.material.materialswitch.MaterialSwitch | ||||
|         android:id="@+id/dual_page_invert" | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content" | ||||
|         android:paddingStart="16dp" | ||||
|         android:paddingEnd="16dp" | ||||
|         android:paddingHorizontal="16dp" | ||||
|         android:paddingVertical="16dp" | ||||
|         android:text="@string/pref_dual_page_invert" | ||||
|         android:textColor="?android:attr/textColorSecondary" | ||||
|         android:visibility="gone" | ||||
|   | ||||
| @@ -77,6 +77,8 @@ | ||||
|         <item name="bottomNavigationStyle">@style/Widget.Tachiyomi.BottomNavigationView</item> | ||||
|         <item name="navigationRailStyle">@style/Widget.Tachiyomi.NavigationRailView</item> | ||||
|         <item name="switchStyle">@style/Widget.Tachiyomi.Switch</item> | ||||
|         <item name="materialSwitchStyle">@style/Widget.Material3.CompoundButton.MaterialSwitch</item> | ||||
|         <item name="switchPreferenceCompatStyle">@style/Widget.Tachiyomi.Switch</item> | ||||
|         <item name="sliderStyle">@style/Widget.Tachiyomi.Slider</item> | ||||
|         <item name="materialCardViewStyle">@style/Widget.Material3.CardView.Elevated</item> | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user