mirror of
				https://github.com/mihonapp/mihon.git
				synced 2025-10-30 22:07:57 +01:00 
			
		
		
		
	Migrate ReaderColorFilterSettings to Compose
It'll eventually be a tab with the other settings again once the other tabs are also migrated over so it's just a single Compose sheet.
This commit is contained in:
		| @@ -119,12 +119,25 @@ | ||||
|                     android:background="?attr/selectableItemBackgroundBorderless" | ||||
|                     android:contentDescription="@string/action_settings" | ||||
|                     android:padding="@dimen/screen_edge_margin" | ||||
|                     app:layout_constraintEnd_toEndOf="parent" | ||||
|                     app:layout_constraintEnd_toStartOf="@+id/action_color_settings" | ||||
|                     app:layout_constraintStart_toEndOf="@id/action_rotation" | ||||
|                     app:layout_constraintTop_toTopOf="parent" | ||||
|                     app:srcCompat="@drawable/ic_settings_24dp" | ||||
|                     app:tint="?attr/colorOnSurface" /> | ||||
|  | ||||
|                 <ImageButton | ||||
|                     android:id="@+id/action_color_settings" | ||||
|                     android:layout_width="wrap_content" | ||||
|                     android:layout_height="match_parent" | ||||
|                     android:background="?attr/selectableItemBackgroundBorderless" | ||||
|                     android:contentDescription="@string/custom_filter" | ||||
|                     android:padding="@dimen/screen_edge_margin" | ||||
|                     app:layout_constraintEnd_toEndOf="parent" | ||||
|                     app:layout_constraintStart_toEndOf="@id/action_settings" | ||||
|                     app:layout_constraintTop_toTopOf="parent" | ||||
|                     app:srcCompat="@drawable/ic_brightness_5_24dp" | ||||
|                     app:tint="?attr/colorOnSurface" /> | ||||
|  | ||||
|             </androidx.constraintlayout.widget.ConstraintLayout> | ||||
|  | ||||
|         </LinearLayout> | ||||
|   | ||||
| @@ -1,269 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <androidx.core.widget.NestedScrollView xmlns:android="http://schemas.android.com/apk/res/android" | ||||
|     xmlns:app="http://schemas.android.com/apk/res-auto" | ||||
|     xmlns:tools="http://schemas.android.com/tools" | ||||
|     android:layout_width="match_parent" | ||||
|     android:layout_height="wrap_content"> | ||||
|  | ||||
|     <androidx.constraintlayout.widget.ConstraintLayout | ||||
|         android:layout_width="match_parent" | ||||
|         android:layout_height="wrap_content"> | ||||
|  | ||||
|         <!-- Brightness --> | ||||
|  | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/custom_brightness" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_custom_brightness" | ||||
|             app:layout_constraintTop_toTopOf="parent" /> | ||||
|  | ||||
|         <!-- Brightness value --> | ||||
|  | ||||
|         <androidx.appcompat.widget.AppCompatImageView | ||||
|             android:id="@+id/txt_brightness_seekbar_icon" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             android:tint="?attr/colorOnBackground" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_brightness" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_brightness" | ||||
|             app:srcCompat="@drawable/ic_brightness_5_24dp" /> | ||||
|  | ||||
|         <com.google.android.material.slider.Slider | ||||
|             android:id="@+id/slider_brightness" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginStart="8dp" | ||||
|             android:layout_marginEnd="8dp" | ||||
|             android:padding="8dp" | ||||
|             android:valueFrom="-75.0" | ||||
|             android:valueTo="100.0" | ||||
|             android:stepSize="1.0" | ||||
|             app:layout_constraintEnd_toStartOf="@id/txt_brightness_seekbar_value" | ||||
|             app:layout_constraintStart_toEndOf="@id/txt_brightness_seekbar_icon" | ||||
|             app:layout_constraintTop_toBottomOf="@id/custom_brightness" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_brightness_seekbar_value" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginEnd="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_brightness" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_brightness" | ||||
|             tools:text="50" /> | ||||
|  | ||||
|         <!-- Color filter --> | ||||
|  | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/switch_color_filter" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_custom_color_filter" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toBottomOf="@+id/slider_brightness" /> | ||||
|  | ||||
|         <!-- Red filter --> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_red_symbol" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:text="@string/color_filter_r_value" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_red" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_red" /> | ||||
|  | ||||
|         <com.google.android.material.slider.Slider | ||||
|             android:id="@+id/slider_color_filter_red" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginStart="8dp" | ||||
|             android:layout_marginEnd="8dp" | ||||
|             android:stepSize="1.0" | ||||
|             android:valueTo="255.0" | ||||
|             android:padding="8dp" | ||||
|             app:layout_constraintEnd_toStartOf="@id/txt_color_filter_red_value" | ||||
|             app:layout_constraintStart_toEndOf="@id/color_filter_symbols_barrier" | ||||
|             app:layout_constraintTop_toBottomOf="@id/switch_color_filter" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_red_value" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_alignParentEnd="true" | ||||
|             android:layout_marginEnd="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_red" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_red" | ||||
|             tools:text="255" /> | ||||
|  | ||||
|         <!-- Green filter --> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_green_symbol" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:text="@string/color_filter_g_value" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_green" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_green" /> | ||||
|  | ||||
|         <com.google.android.material.slider.Slider | ||||
|             android:id="@+id/slider_color_filter_green" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginStart="8dp" | ||||
|             android:layout_marginEnd="8dp" | ||||
|             android:stepSize="1.0" | ||||
|             android:valueTo="255.0" | ||||
|             android:padding="8dp" | ||||
|             app:layout_constraintEnd_toStartOf="@id/txt_color_filter_green_value" | ||||
|             app:layout_constraintStart_toEndOf="@id/color_filter_symbols_barrier" | ||||
|             app:layout_constraintTop_toBottomOf="@id/slider_color_filter_red" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_green_value" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_alignParentEnd="true" | ||||
|             android:layout_marginEnd="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_green" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_green" | ||||
|             tools:text="255" /> | ||||
|  | ||||
|         <!-- Blue filter --> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_blue_symbol" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:text="@string/color_filter_b_value" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_blue" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_blue" /> | ||||
|  | ||||
|         <com.google.android.material.slider.Slider | ||||
|             android:id="@+id/slider_color_filter_blue" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginStart="8dp" | ||||
|             android:layout_marginEnd="8dp" | ||||
|             android:stepSize="1.0" | ||||
|             android:valueTo="255.0" | ||||
|             android:padding="8dp" | ||||
|             app:layout_constraintEnd_toStartOf="@id/txt_color_filter_blue_value" | ||||
|             app:layout_constraintStart_toEndOf="@id/color_filter_symbols_barrier" | ||||
|             app:layout_constraintTop_toBottomOf="@id/slider_color_filter_green" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_blue_value" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_alignParentEnd="true" | ||||
|             android:layout_marginEnd="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_blue" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_blue" | ||||
|             tools:text="255" /> | ||||
|  | ||||
|         <!-- Alpha filter --> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_alpha_symbol" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingStart="16dp" | ||||
|             android:text="@string/color_filter_a_value" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_alpha" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_alpha" /> | ||||
|  | ||||
|         <com.google.android.material.slider.Slider | ||||
|             android:id="@+id/slider_color_filter_alpha" | ||||
|             android:layout_width="0dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_marginStart="8dp" | ||||
|             android:layout_marginEnd="8dp" | ||||
|             android:stepSize="1.0" | ||||
|             android:valueTo="255.0" | ||||
|             android:padding="8dp" | ||||
|             app:layout_constraintEnd_toStartOf="@id/txt_color_filter_alpha_value" | ||||
|             app:layout_constraintStart_toEndOf="@id/color_filter_symbols_barrier" | ||||
|             app:layout_constraintTop_toBottomOf="@id/slider_color_filter_blue" /> | ||||
|  | ||||
|         <TextView | ||||
|             android:id="@+id/txt_color_filter_alpha_value" | ||||
|             android:layout_width="30dp" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:layout_alignParentEnd="true" | ||||
|             android:layout_marginEnd="16dp" | ||||
|             android:textAppearance="?attr/textAppearanceTitleSmall" | ||||
|             app:layout_constraintBottom_toBottomOf="@id/slider_color_filter_alpha" | ||||
|             app:layout_constraintEnd_toEndOf="parent" | ||||
|             app:layout_constraintTop_toTopOf="@id/slider_color_filter_alpha" | ||||
|             tools:text="255" /> | ||||
|  | ||||
|         <!-- Filter mode --> | ||||
|  | ||||
|         <eu.kanade.tachiyomi.widget.MaterialSpinnerView | ||||
|             android:id="@+id/color_filter_mode" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:entries="@array/color_filter_modes" | ||||
|             app:layout_constraintStart_toStartOf="parent" | ||||
|             app:layout_constraintTop_toBottomOf="@id/slider_color_filter_alpha" | ||||
|             app:title="@string/pref_color_filter_mode" /> | ||||
|  | ||||
|         <!-- Grayscale --> | ||||
|  | ||||
|         <com.google.android.material.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/grayscale" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             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.materialswitch.MaterialSwitch | ||||
|             android:id="@+id/inverted_colors" | ||||
|             android:layout_width="match_parent" | ||||
|             android:layout_height="wrap_content" | ||||
|             android:paddingHorizontal="16dp" | ||||
|             android:paddingVertical="16dp" | ||||
|             android:text="@string/pref_inverted_colors" | ||||
|             android:textColor="?android:attr/textColorSecondary" | ||||
|             app:layout_constraintTop_toBottomOf="@id/grayscale" /> | ||||
|  | ||||
|         <androidx.constraintlayout.widget.Barrier | ||||
|             android:id="@+id/color_filter_symbols_barrier" | ||||
|             android:layout_width="wrap_content" | ||||
|             android:layout_height="wrap_content" | ||||
|             app:barrierDirection="end" | ||||
|             app:constraint_referenced_ids="txt_color_filter_alpha_symbol,txt_color_filter_blue_symbol,txt_color_filter_red_symbol,txt_color_filter_green_symbol" /> | ||||
|  | ||||
|     </androidx.constraintlayout.widget.ConstraintLayout> | ||||
|  | ||||
| </androidx.core.widget.NestedScrollView> | ||||
| @@ -1,15 +0,0 @@ | ||||
| <?xml version="1.0" encoding="utf-8"?> | ||||
| <resources> | ||||
|  | ||||
|     <string-array name="color_filter_modes"> | ||||
|         <item>@string/label_default</item> | ||||
|         <item>@string/filter_mode_multiply</item> | ||||
|         <item>@string/filter_mode_screen</item> | ||||
|  | ||||
|         <!-- Attributes specific for SDK 28 and up  --> | ||||
|         <item>@string/filter_mode_overlay</item> | ||||
|         <item>@string/filter_mode_lighten</item> | ||||
|         <item>@string/filter_mode_darken</item> | ||||
|     </string-array> | ||||
|  | ||||
| </resources> | ||||
| @@ -67,12 +67,6 @@ | ||||
|         <item>@string/rotation_reverse_portrait</item> | ||||
|     </string-array> | ||||
|  | ||||
|     <string-array name="color_filter_modes"> | ||||
|         <item>@string/label_default</item> | ||||
|         <item>@string/filter_mode_multiply</item> | ||||
|         <item>@string/filter_mode_screen</item> | ||||
|     </string-array> | ||||
|  | ||||
|     <string-array name="invert_tapping_mode"> | ||||
|         <item>@string/tapping_inverted_none</item> | ||||
|         <item>@string/tapping_inverted_horizontal</item> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user