<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/display_bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bottom_sheet_rounded_background">

    <androidx.core.widget.NestedScrollView
        android:id="@+id/settings_scroll_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <LinearLayout
            android:id="@+id/sort_layout"
            style="@style/BottomSheetDialogTheme"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:background="@android:color/transparent"
            android:orientation="vertical"
            android:paddingTop="12dp"
            app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

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

                <com.google.android.material.textview.MaterialTextView
                    style="@style/TextAppearance.MaterialComponents.Headline6"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:paddingStart="16dp"
                    android:paddingEnd="12dp"
                    android:text="@string/sort" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/set_as_default_sort"
                    style="@style/Theme.Widget.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/set_as_default_for_all" />
            </LinearLayout>

            <RadioGroup
                android:id="@+id/sort_group"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingStart="12dp"
                android:paddingEnd="12dp">

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/sort_newest"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_weight="1"
                    android:text="@string/newest_first" />

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/sort_oldest"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="12dp"
                    android:layout_weight="1"
                    android:text="@string/oldest_first" />
            </RadioGroup>

            <include layout="@layout/chapter_filter_layout"
                android:id="@+id/chapter_filter_layout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content" />

            <com.google.android.material.textview.MaterialTextView
                style="@style/TextAppearance.MaterialComponents.Headline6"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="12dp"
                android:paddingStart="16dp"
                android:paddingEnd="12dp"
                android:text="@string/more" />

            <RadioGroup
                android:id="@+id/sort_method_group"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="horizontal"
                android:paddingStart="12dp"
                android:paddingEnd="12dp">

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/sort_by_source"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/sort_by_source_s_order" />

                <com.google.android.material.radiobutton.MaterialRadioButton
                    android:id="@+id/sort_by_number"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="@string/sort_by_chapter_number" />
            </RadioGroup>

            <com.google.android.material.checkbox.MaterialCheckBox
                android:id="@+id/hide_titles"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="12dp"
                android:layout_marginEnd="12dp"
                android:text="@string/hide_chapter_titles" />

        </LinearLayout>
    </androidx.core.widget.NestedScrollView>

    <ImageView
        android:id="@+id/pill"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center|top"
        android:layout_marginTop="5dp"
        android:alpha="0.25"
        android:contentDescription="@string/drag_handle"
        android:src="@drawable/draggable_pill"
        app:tint="?android:attr/textColorPrimary" />

    <ImageView
        android:id="@+id/close_button"
        android:layout_width="32dp"
        android:layout_height="32dp"
        android:layout_gravity="end"
        android:layout_marginTop="12dp"
        android:layout_marginEnd="12dp"
        android:background="@drawable/round_ripple"
        android:clickable="true"
        android:contentDescription="@string/close"
        android:focusable="true"
        android:src="@drawable/ic_close_24dp"
        app:tint="@color/gray_button" />
</FrameLayout>