<?xml version="1.0" encoding="utf-8"?>
<eu.kanade.tachiyomi.ui.reader.chapter.ReaderChapterSheet 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:id="@+id/chapters_bottom_sheet"
    android:layout_width="match_parent"
    android:layout_height="300dp"
    android:background="@drawable/bottom_sheet_rounded_background"
    android:orientation="vertical"
    app:behavior_peekHeight="60dp"
    app:layout_behavior="com.google.android.material.bottomsheet.BottomSheetBehavior">

    <androidx.constraintlayout.widget.ConstraintLayout
        android:id="@+id/topbar_layout"
        android:layout_width="match_parent"
        android:layout_height="?attr/actionBarSize"
        android:clickable="true"
        android:focusable="true">

        <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:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:tint="?actionBarTintColor" />

        <ImageButton
            android:id="@+id/chapters_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            app:layout_constraintWidth_max="wrap"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/next_title"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/view_chapters"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/webview_button"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toStartOf="parent"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_format_list_numbered_24dp"
            app:tint="?actionBarTintColor" />

        <ImageButton
            android:id="@+id/webview_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/open_in_webview"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/open_in_webview"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/reading_mode"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/chapters_button"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/ic_open_in_webview_24dp"
            app:tint="?actionBarTintColor" />

        <ImageButton
            android:id="@+id/reading_mode"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/reading_mode"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/reading_mode"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/rotation_sheet_button"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/webview_button"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/ic_reader_default_24dp"
            app:tint="?actionBarTintColor" />

        <ImageButton
            android:id="@+id/rotation_sheet_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/open_in_webview"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/rotation"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/crop_borders_sheet_button"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/reading_mode"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/ic_screen_rotation_24dp"
            app:tint="?actionBarTintColor"
            tools:visibility="visible" />

        <ImageButton
            android:id="@+id/crop_borders_sheet_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/crop_borders"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/crop_borders"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/double_page"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/rotation_sheet_button"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/anim_crop_to_free"
            app:tint="?actionBarTintColor"
            tools:visibility="visible" />

        <ImageButton
            android:id="@+id/double_page"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/next_title"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/double_pages"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/shift_page_button"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/crop_borders_sheet_button"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/ic_book_open_variant_24dp"
            app:tint="?actionBarTintColor" />

        <ImageButton
            android:id="@+id/shift_page_button"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/next_title"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/shift_one_page_over"
            android:visibility="gone"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toStartOf="@id/display_options"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/double_page"
            app:layout_constraintTop_toTopOf="parent"
            app:layout_constraintWidth_max="wrap"
            app:srcCompat="@drawable/ic_page_next_outline_24dp"
            app:tint="?actionBarTintColor"
            tools:visibility="visible" />

        <ImageButton
            android:id="@+id/display_options"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:background="?selectableItemBackgroundBorderless"
            android:contentDescription="@string/next_title"
            android:padding="@dimen/material_layout_keylines_screen_edge_margin"
            android:tooltipText="@string/display_options"
            app:layout_constraintBottom_toBottomOf="parent"
            app:layout_constraintEnd_toEndOf="parent"
            app:layout_constraintHorizontal_chainStyle="spread"
            app:layout_constraintStart_toEndOf="@id/shift_page_button"
            app:layout_constraintTop_toTopOf="parent"
            app:srcCompat="@drawable/ic_tune_24dp"
            app:tint="?actionBarTintColor" />
    </androidx.constraintlayout.widget.ConstraintLayout>

    <androidx.recyclerview.widget.RecyclerView
        android:id="@+id/chapter_recycler"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:alpha="0"
        android:background="@android:color/transparent"
        android:clipToPadding="false"
        tools:listitem="@layout/reader_chapter_item" />
</eu.kanade.tachiyomi.ui.reader.chapter.ReaderChapterSheet>