<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.ui.reader.settings.ReaderFilterView 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:id="@+id/filter_bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bottom_sheet_rounded_background"
    android:clipToPadding="false">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/constraint_layout"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:paddingStart="@dimen/material_component_dialogs_padding_around_content_area"
        android:paddingTop="0dp"
        android:paddingEnd="@dimen/material_component_dialogs_padding_around_content_area">

        <androidx.legacy.widget.Space
            android:id="@+id/spinner_end"
            android:layout_width="16dp"
            android:layout_height="0dp"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintStart_toEndOf="parent" />

        <com.google.android.material.button.MaterialButton
            android:id="@+id/swipe_down"
            style="@style/Theme.Widget.Button.TextButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:text="@string/preview"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />

        <!-- Color filter -->

        <androidx.appcompat.widget.SwitchCompat
            android:id="@+id/switch_color_filter"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginTop="4dp"
            android:text="@string/use_custom_color_filter"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toBottomOf="@id/swipe_down"/>

        <!-- Red filter -->

        <SeekBar
            android:id="@+id/seekbar_color_filter_red"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:max="255"
            android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
            app:layout_constraintEnd_toStartOf="@id/txt_color_filter_red_value"
            app:layout_constraintStart_toEndOf="@id/txt_color_filter_red_symbol"
            app:layout_constraintTop_toBottomOf="@id/switch_color_filter" />

        <TextView
            android:id="@+id/txt_color_filter_red_symbol"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/red_initial"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />

        <TextView
            android:id="@+id/txt_color_filter_red_value"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_red"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_red" />

        <!-- Green filter -->

        <SeekBar
            android:id="@+id/seekbar_color_filter_green"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:max="255"
            android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
            app:layout_constraintEnd_toStartOf="@id/txt_color_filter_green_value"
            app:layout_constraintStart_toEndOf="@id/txt_color_filter_green_symbol"
            app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_red" />

        <TextView
            android:id="@+id/txt_color_filter_green_symbol"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/green_initial"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />

        <TextView
            android:id="@+id/txt_color_filter_green_value"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_green"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_green" />

        <!-- Blue filter -->

        <SeekBar
            android:id="@+id/seekbar_color_filter_blue"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:max="255"
            android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
            app:layout_constraintEnd_toStartOf="@id/txt_color_filter_blue_value"
            app:layout_constraintStart_toEndOf="@id/txt_color_filter_blue_symbol"
            app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_green" />

        <TextView
            android:id="@+id/txt_color_filter_blue_symbol"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/blue_initial"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />

        <TextView
            android:id="@+id/txt_color_filter_blue_value"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_blue"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_blue" />

        <!-- Alpha filter -->

        <SeekBar
            android:id="@+id/seekbar_color_filter_alpha"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:max="255"
            android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
            app:layout_constraintEnd_toStartOf="@id/txt_color_filter_alpha_value"
            app:layout_constraintStart_toEndOf="@id/txt_color_filter_alpha_symbol"
            app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_blue" />

        <TextView
            android:id="@+id/txt_color_filter_alpha_symbol"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="@string/alpha_initial"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />

        <TextView
            android:id="@+id/txt_color_filter_alpha_value"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/seekbar_color_filter_alpha"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/seekbar_color_filter_alpha" />

        <!-- Filter mode -->

        <eu.kanade.tachiyomi.widget.MaterialSpinnerView
            android:id="@+id/color_filter_mode"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            app:title="@string/color_filter_blend_mode"
            android:entries="@array/color_filter_modes"
            app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_alpha"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintEnd_toEndOf="@id/spinner_end" />

        <!-- Brightness -->

        <androidx.appcompat.widget.SwitchCompat
            android:id="@+id/custom_brightness"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:text="@string/use_custom_brightness"
            app:layout_constraintTop_toBottomOf="@id/color_filter_mode" />

        <!-- Brightness value -->

        <eu.kanade.tachiyomi.widget.NegativeSeekBar
            android:id="@+id/brightness_seekbar"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_marginStart="8dp"
            android:layout_marginEnd="8dp"
            android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
            app:layout_constraintBottom_toBottomOf="parent"
            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"
            app:max_seek="100"
            app:min_seek="-75" />

        <androidx.appcompat.widget.AppCompatImageView
            android:id="@+id/txt_brightness_seekbar_icon"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            android:tint="?android:attr/textColorSecondary"
            app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="@id/brightness_seekbar"
            app:srcCompat="@drawable/ic_brightness_day_24dp" />

        <TextView
            android:id="@+id/txt_brightness_seekbar_value"
            android:layout_width="30dp"
            android:layout_height="wrap_content"
            android:textAppearance="@style/TextAppearance.Regular.SubHeading.Secondary"
            app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintTop_toTopOf="@id/brightness_seekbar" />

    </androidx.constraintlayout.widget.ConstraintLayout>
</eu.kanade.tachiyomi.ui.reader.settings.ReaderFilterView>