<?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:orientation="vertical"
            android:paddingTop="12dp"
            app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

            <androidx.constraintlayout.widget.ConstraintLayout
                android:id="@+id/sort_title_bar"
                android:layout_width="match_parent"
                android:layout_height="wrap_content">

                <com.google.android.material.textview.MaterialTextView
                    android:id="@+id/sort_title"
                    style="?textAppearanceHeadlineSmall"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_gravity="center_vertical"
                    app:layout_constraintStart_toStartOf="parent"
                    app:layout_constraintTop_toTopOf="parent"
                    app:layout_constraintBottom_toBottomOf="parent"
                    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="38sp"
                    android:padding="4dp"
                    android:layout_marginStart="6dp"
                    android:layout_gravity="center_vertical"
                    app:layout_constraintBaseline_toBaselineOf="@id/sort_title"
                    app:layout_constraintStart_toEndOf="@id/sort_title"
                    android:text="@string/set_as_default" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/reset_as_default_sort"
                    style="@style/Theme.Widget.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="38sp"
                    android:padding="4dp"
                    android:layout_marginEnd="6dp"
                    android:layout_gravity="center_vertical"
                    app:layout_constraintStart_toEndOf="@id/set_as_default_sort"
                    app:layout_constraintHorizontal_bias="1.0"
                    app:layout_constraintBaseline_toBaselineOf="@id/sort_title"
                    app:layout_constraintEnd_toEndOf="parent"
                    android:text="@string/reset" />
            </androidx.constraintlayout.widget.ConstraintLayout>

            <eu.kanade.tachiyomi.widget.SortTextView
                android:id="@+id/by_source"
                android:layout_width="match_parent"
                android:text="@string/by_source_order"
                android:layout_height="wrap_content"/>

            <eu.kanade.tachiyomi.widget.SortTextView
                android:id="@+id/by_chapter_number"
                android:layout_width="match_parent"
                android:text="@string/by_chapter_number"
                android:layout_height="wrap_content"/>

            <eu.kanade.tachiyomi.widget.SortTextView
                android:id="@+id/by_upload_date"
                android:layout_width="match_parent"
                android:text="@string/by_update_date"
                android:layout_height="wrap_content"/>

            <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.button.MaterialButton
                android:id="@+id/filter_groups_button"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginStart="16dp"
                android:layout_marginTop="12dp"
                android:layout_marginEnd="16dp"
                android:text="@string/filter_groups"
                android:textAlignment="center"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent" />

            <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_marginTop="6dp"
                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="?attr/colorOnBackground" />
</FrameLayout>