<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/filter_bottom_sheet"
    style="@style/BottomSheetDialogTheme"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:background="@drawable/bottom_sheet_rounded_background"
    android:elevation="7dp"
    android:orientation="vertical"
    app:behavior_peekHeight="60dp"
    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content">

        <!-- View for dragging the sheet without highlighting everything -->
        <View
            android:layout_width="0dp"
            android:layout_height="0dp"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            android:clickable="true"
            android:focusable="true" />

        <LinearLayout
            android:id="@+id/sheet_layout"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent">

            <HorizontalScrollView
                android:id="@+id/filter_scroll"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginTop="2dp"
                android:clipToPadding="false"
                android:fadingEdgeLength="20dp"
                android:paddingTop="8dp"
                android:paddingBottom="6dp"
                android:requiresFadingEdge="horizontal"
                android:scrollbars="none">

                <LinearLayout
                    android:id="@+id/filter_layout"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:gravity="center_vertical"
                    android:orientation="horizontal"
                    android:paddingStart="10dp"
                    android:paddingEnd="20dp">

                    <ImageView
                        android:id="@+id/clear_button"
                        android:layout_width="32dp"
                        android:layout_height="32dp"
                        android:layout_marginStart="10dp"
                        android:layout_marginEnd="10dp"
                        android:background="@drawable/round_clear_border"
                        android:clickable="true"
                        android:contentDescription="@string/clear"
                        android:focusable="true"
                        android:padding="3dp"
                        android:src="@drawable/ic_close_24dp"
                        app:tint="@color/gray_button" />

                </LinearLayout>
            </HorizontalScrollView>

            <LinearLayout
                android:id="@+id/first_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:orientation="horizontal">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/group_by"
                    style="@style/Theme.Widget.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginEnd="10dp"
                    android:maxLines="2"
                    android:text="@string/group_library_by"
                    android:textColor="?android:attr/textColorPrimary"
                    app:icon="@drawable/ic_label_outline_24dp"
                    app:iconTint="?android:attr/textColorPrimary" />

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/expand_categories"
                    style="@style/Theme.Widget.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:maxLines="2"
                    android:text="@string/expand_all_categories"
                    android:textColor="?android:attr/textColorPrimary"
                    app:icon="@drawable/ic_expand_more_24dp"
                    app:iconTint="?android:attr/textColorPrimary" />
            </LinearLayout>

            <LinearLayout
                android:id="@+id/second_layout"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:orientation="horizontal">

                <com.google.android.material.button.MaterialButton
                    android:id="@+id/view_options"
                    style="@style/Theme.Widget.Button.TextButton"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="10dp"
                    android:maxLines="2"
                    android:text="@string/display_options"
                    android:textColor="?android:attr/textColorPrimary"
                    app:icon="@drawable/ic_tune_24dp"
                    app:iconTint="?android:attr/textColorPrimary" />

            </LinearLayout>
        </LinearLayout>

        <ImageView
            android:id="@+id/pill"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:alpha="0.25"
            android:contentDescription="@string/drag_handle"
            android:src="@drawable/draggable_pill"
            app:tint="?android:attr/textColorPrimary"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent" />
    </androidx.constraintlayout.widget.ConstraintLayout>
</eu.kanade.tachiyomi.ui.library.filter.FilterBottomSheet>