<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:padding="16dp">

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

    <!-- Color filter -->

    <androidx.appcompat.widget.SwitchCompat
        android:id="@+id/switch_color_filter"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/pref_custom_color_filter"
        app:layout_constraintTop_toTopOf="parent"
        app:layout_constraintRight_toRightOf="parent"
        app:layout_constraintLeft_toLeftOf="parent" />

    <!-- Red filter -->

    <SeekBar
        android:id="@+id/seekbar_color_filter_red"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:max="255"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
        app:layout_constraintTop_toBottomOf="@id/switch_color_filter"
        app:layout_constraintLeft_toRightOf="@id/txt_color_filter_red_symbol"
        app:layout_constraintRight_toLeftOf="@id/txt_color_filter_red_value" />

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

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

    <!-- Green filter -->

    <SeekBar
        android:id="@+id/seekbar_color_filter_green"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:max="255"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
        app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_red"
        app:layout_constraintLeft_toRightOf="@id/txt_color_filter_green_symbol"
        app:layout_constraintRight_toLeftOf="@id/txt_color_filter_green_value" />

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

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

    <!-- Blue filter -->

    <SeekBar
        android:id="@+id/seekbar_color_filter_blue"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:max="255"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
        app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_green"
        app:layout_constraintLeft_toRightOf="@id/txt_color_filter_blue_symbol"
        app:layout_constraintRight_toLeftOf="@id/txt_color_filter_blue_value" />

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

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

    <!-- Alpha filter -->

    <SeekBar
        android:id="@+id/seekbar_color_filter_alpha"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:max="255"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
        app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_blue"
        app:layout_constraintLeft_toRightOf="@id/txt_color_filter_alpha_symbol"
        app:layout_constraintRight_toLeftOf="@id/txt_color_filter_alpha_value" />

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

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

    <!-- Filter mode -->

    <TextView
        android:id="@+id/color_filter_mode_text"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:text="@string/pref_color_filter_mode"
        app:layout_constraintLeft_toLeftOf="parent"
        app:layout_constraintRight_toLeftOf="@id/color_filter_mode"
        app:layout_constraintBaseline_toBaselineOf="@id/color_filter_mode"/>

    <androidx.appcompat.widget.AppCompatSpinner
        android:id="@+id/color_filter_mode"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginTop="16dp"
        android:entries="@array/color_filter_modes"
        app:layout_constraintTop_toBottomOf="@id/seekbar_color_filter_alpha"
        app:layout_constraintLeft_toRightOf="@id/verticalcenter"
        app:layout_constraintRight_toRightOf="@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="16dp"
        android:text="@string/pref_custom_brightness"
        app:layout_constraintTop_toBottomOf="@id/color_filter_mode_text"/>

    <!-- Brightness value -->

    <eu.kanade.tachiyomi.widget.NegativeSeekBar
        android:id="@+id/brightness_seekbar"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_marginLeft="8dp"
        android:layout_marginRight="8dp"
        android:padding="@dimen/material_component_text_fields_floating_label_padding_between_label_and_input_text"
        app:layout_constraintTop_toBottomOf="@id/custom_brightness"
        app:layout_constraintLeft_toRightOf="@id/txt_brightness_seekbar_icon"
        app:layout_constraintRight_toLeftOf="@id/txt_brightness_seekbar_value"
        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:srcCompat="@drawable/ic_brightness_5_black_24dp"
        app:layout_constraintTop_toTopOf="@id/brightness_seekbar"
        app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
        app:layout_constraintLeft_toLeftOf="parent"/>

    <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_constraintTop_toTopOf="@id/brightness_seekbar"
        app:layout_constraintBottom_toBottomOf="@id/brightness_seekbar"
        app:layout_constraintRight_toRightOf="parent"/>

    <androidx.constraintlayout.widget.Guideline
        android:id="@+id/verticalcenter"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        app:layout_constraintGuide_percent="0.5" />

</androidx.constraintlayout.widget.ConstraintLayout>
