<?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="match_parent">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:layout_marginStart="32dp"
        android:layout_marginEnd="32dp"
        android:orientation="vertical"
        android:paddingBottom="32dp">

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="24dp"
            android:layout_marginBottom="16dp"
            android:fontFamily="@font/poppins_semi_bold"
            android:text="@string/reader_settings"
            android:textAlignment="center"
            android:textSize="16sp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/poppins_bold"
                android:text="@string/theme" />

            <ani.dantotsu.SpinnerNoSwipe
                android:id="@+id/themeSelect"
                android:layout_width="wrap_content"
                android:layout_height="48dp"
                android:entries="@array/themes"
                android:popupBackground="@drawable/round_corner"
                tools:ignore="SpeakableTextPresentCheck" />
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="8dp"
            android:layout_marginBottom="8dp"
            android:gravity="center"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:alpha="0.58"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/layout" />

                <TextView
                    android:id="@+id/layoutText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/poppins_bold"
                    android:textColor="?attr/colorSecondary"
                    tools:ignore="TextContrastCheck"
                    tools:text="Continuous" />
            </LinearLayout>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/paged"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:alpha="0.33"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_round_amp_stories_24"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/continuous"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:alpha="0.33"
                    android:background="?android:attr/selectableItemBackground"
                    android:src="@drawable/ic_round_view_column_24"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:layout_marginTop="16dp"
            android:layout_marginBottom="8dp"
            android:gravity="center"
            android:orientation="horizontal">

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="match_parent"
                android:layout_weight="1"
                android:orientation="vertical">

                <TextView
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:alpha="0.58"
                    android:fontFamily="@font/poppins_bold"
                    android:text="@string/dual_page" />

                <TextView
                    android:id="@+id/dualPageText"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:fontFamily="@font/poppins_bold"
                    android:textColor="?attr/colorSecondary"
                    tools:ignore="TextContrastCheck"
                    tools:text="Force" />
            </LinearLayout>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/dualNo"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:alpha="0.33"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_round_close_24"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/dualAuto"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:alpha="0.33"
                    android:background="?android:attr/selectableItemBackground"
                    android:src="@drawable/ic_round_screen_rotation_24"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck,DuplicateSpeakableTextCheck" />
            </androidx.cardview.widget.CardView>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/dualForce"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:alpha="0.33"
                    android:background="?android:attr/selectableItemBackground"
                    android:src="@drawable/ic_round_menu_book_24"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:gravity="center"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/poppins_bold"
                android:text="Line Height" />

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/decrementLineHeight"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_minus"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/lineHeight"
                    android:layout_width="64dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:textSize="12sp"
                    tools:ignore="SpeakableTextPresentCheck" />
            </com.google.android.material.textfield.TextInputLayout>


            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/incrementLineHeight"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_add"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:gravity="center"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/poppins_bold"
                android:text="Margin" />

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/decrementMargin"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_minus"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/margin"
                    android:layout_width="64dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:textSize="12sp"
                    tools:ignore="SpeakableTextPresentCheck" />
            </com.google.android.material.textfield.TextInputLayout>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/incrementMargin"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_add"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>
        </LinearLayout>

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:gravity="center"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/poppins_bold"
                android:text="Maximum Inline Size" />

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/decrementMaxInlineSize"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_minus"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/maxInlineSize"
                    android:layout_width="64dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:textSize="12sp"
                    tools:ignore="SpeakableTextPresentCheck" />
            </com.google.android.material.textfield.TextInputLayout>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/incrementMaxInlineSize"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_add"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>
        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:alpha="0.58"
            android:fontFamily="@font/poppins_family"
            android:text="Maximum column width (horizontal writing) or height (vertical writing)"
            android:textSize="14sp" />

        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:layout_marginBottom="10dp"
            android:gravity="center"
            android:orientation="horizontal">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:fontFamily="@font/poppins_bold"
                android:text="Maximum Block Size" />

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/decrementMaxBlockSize"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_minus"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>

            <com.google.android.material.textfield.TextInputLayout
                style="@style/Widget.Material3.TextInputLayout.OutlinedBox.Dense"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="8dp"
                android:layout_marginEnd="8dp">

                <com.google.android.material.textfield.TextInputEditText
                    android:id="@+id/maxBlockSize"
                    android:layout_width="64dp"
                    android:layout_height="wrap_content"
                    android:inputType="number"
                    android:textSize="12sp"
                    tools:ignore="SpeakableTextPresentCheck" />
            </com.google.android.material.textfield.TextInputLayout>

            <androidx.cardview.widget.CardView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                app:cardBackgroundColor="@color/nav_bg_inv"
                app:cardCornerRadius="16dp"
                app:cardElevation="0dp">

                <ImageButton
                    android:id="@+id/incrementMaxBlockSize"
                    android:layout_width="48dp"
                    android:layout_height="48dp"
                    android:background="?android:attr/selectableItemBackground"
                    android:scaleX="-1"
                    android:src="@drawable/ic_add"
                    app:tint="?attr/colorOnBackground"
                    tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />
            </androidx.cardview.widget.CardView>
        </LinearLayout>

        <TextView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginBottom="8dp"
            android:alpha="0.58"
            android:fontFamily="@font/poppins_family"
            android:text="Maximum height (horizontal writing) or width (vertical writing)"
            android:textSize="14sp" />

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/useDarkTheme"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:checked="false"
            android:drawableStart="@drawable/ic_round_brightness_4_24"
            android:drawablePadding="16dp"
            android:elegantTextHeight="true"
            android:fontFamily="@font/poppins_bold"
            android:minHeight="64dp"
            android:text="Use Dark Theme"
            android:textAlignment="viewStart"
            android:textColor="?attr/colorOnBackground"
            app:cornerRadius="0dp"
            app:drawableTint="?attr/colorPrimary"
            app:showText="false"
            app:thumbTint="@color/button_switch_track"
            tools:ignore="VisualLintButtonSize" />

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/keepScreenOn"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:checked="false"
            android:drawableStart="@drawable/ic_baseline_screen_lock_portrait_24"
            android:drawablePadding="16dp"
            android:elegantTextHeight="true"
            android:fontFamily="@font/poppins_bold"
            android:minHeight="64dp"
            android:text="@string/keep_screen_on"
            android:textAlignment="viewStart"
            android:textColor="?attr/colorOnBackground"
            app:cornerRadius="0dp"
            app:drawableTint="?attr/colorPrimary"
            app:showText="false"
            app:thumbTint="@color/button_switch_track"
            tools:ignore="VisualLintButtonSize" />

        <com.google.android.material.switchmaterial.SwitchMaterial
            android:id="@+id/volumeButton"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:checked="false"
            android:drawableStart="@drawable/ic_round_touch_app_24"
            android:drawablePadding="16dp"
            android:elegantTextHeight="true"
            android:enabled="true"
            android:fontFamily="@font/poppins_bold"
            android:minHeight="64dp"
            android:text="@string/volume_buttons"
            android:textAlignment="viewStart"
            android:textColor="?attr/colorOnBackground"
            app:cornerRadius="0dp"
            app:drawableTint="?attr/colorPrimary"
            app:showText="false"
            app:thumbTint="@color/button_switch_track"
            tools:ignore="VisualLintButtonSize" />
    </LinearLayout>

</androidx.core.widget.NestedScrollView>