<?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"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".media.novel.novelreader.NovelReaderActivity">

    <com.vipulog.ebookreader.EbookReaderView
        android:id="@+id/bookReader"
        android:layout_width="match_parent"
        android:layout_height="match_parent" />

    <LinearLayout
        android:id="@+id/novelReaderCont"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:orientation="vertical"
        android:visibility="gone"
        tools:visibility="visible">

        <FrameLayout
            android:id="@+id/novelReaderTopCont"
            android:layout_width="match_parent"
            android:layout_height="wrap_content">

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleY="-1"
                app:srcCompat="@drawable/linear_gradient_black"
                tools:ignore="ContentDescription" />

            <ImageView
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:scaleY="-1"
                app:srcCompat="@drawable/linear_gradient_black"
                tools:ignore="ContentDescription" />

            <LinearLayout
                android:id="@+id/novelReaderTopLayout"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_marginBottom="32dp"
                android:clipToPadding="false"
                android:orientation="vertical"
                android:padding="8dp">

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

                    <ImageButton
                        android:id="@+id/novelReaderBack"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:backgroundTint="#00FFFFFF"
                        android:src="@drawable/ic_round_arrow_back_ios_new_24"
                        tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />

                    <LinearLayout
                        android:layout_width="0dp"
                        android:layout_height="wrap_content"
                        android:layout_weight="1"
                        android:gravity="center_vertical"
                        android:orientation="vertical">

                        <ani.dantotsu.SpinnerNoSwipe
                            android:id="@+id/novelReaderChapterSelect"
                            android:layout_width="match_parent"
                            android:layout_height="48dp"
                            android:layout_marginEnd="0dp"
                            android:layout_marginBottom="-10dp"
                            android:background="@drawable/spinner_icon_manga"
                            android:backgroundTint="#fff"
                            android:backgroundTintMode="src_atop"
                            android:entries="@array/tips"
                            android:popupBackground="@drawable/round_corner"
                            tools:ignore="SpeakableTextPresentCheck" />

                        <TextView
                            android:id="@+id/novelReaderTitle"
                            android:layout_width="match_parent"
                            android:layout_height="wrap_content"
                            android:layout_marginEnd="48dp"
                            android:fontFamily="@font/poppins"
                            android:singleLine="false"
                            android:textColor="@color/bg_white"
                            android:textSize="12sp"
                            tools:ignore="TextContrastCheck"
                            tools:text="@string/popular_anime" />

                    </LinearLayout>

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

                        <ImageButton
                            android:id="@+id/novelReaderDownload"
                            android:layout_width="wrap_content"
                            android:layout_height="48dp"
                            android:backgroundTint="#00FFFFFF"
                            android:src="@drawable/ic_download_24"
                            android:visibility="gone"
                            app:layout_constraintBottom_toBottomOf="parent"
                            app:layout_constraintEnd_toEndOf="parent"
                            tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />

                        <ImageButton
                            android:id="@+id/novelReaderSettings"
                            android:layout_width="48dp"
                            android:layout_height="48dp"
                            android:backgroundTint="#00FFFFFF"
                            android:scaleType="fitCenter"
                            android:src="@drawable/ic_round_settings_24"
                            app:tint="#fff"
                            tools:ignore="ContentDescription,SpeakableTextPresentCheck,ImageContrastCheck" />

                    </LinearLayout>

                </LinearLayout>

                <TextView
                    android:id="@+id/novelReaderSource"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="-8dp"
                    android:layout_marginEnd="16dp"
                    android:fontFamily="@font/poppins_bold"
                    android:textAlignment="textEnd"
                    android:textColor="#fff"
                    android:textSize="12sp"
                    tools:ignore="TextContrastCheck"
                    tools:text="@string/server_selector" />

            </LinearLayout>
        </FrameLayout>

        <FrameLayout
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:layout_marginTop="-24dp"
            android:layout_marginBottom="-24dp"
            android:layout_weight="1">

            <FrameLayout
                android:id="@+id/novelReaderSliderContainer"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="bottom|end"
                android:layout_margin="16dp"
                tools:ignore="UselessParent">

                <ImageView
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    app:srcCompat="@drawable/rounded_top_nav"
                    tools:ignore="ContentDescription,ImageContrastCheck" />

                <com.google.android.material.slider.Slider
                    android:id="@+id/novelReaderSlider"
                    android:layout_width="match_parent"
                    android:layout_height="match_parent"
                    android:layout_gravity="center"
                    android:layout_marginStart="8dp"
                    android:layout_marginEnd="8dp"
                    android:contentDescription="@string/current_page"
                    android:valueFrom="0"
                    android:valueTo="1"
                    app:labelBehavior="floating"
                    app:labelStyle="@style/fontTooltip"
                    app:thumbRadius="8dp"
                    app:tickColor="#0000"
                    app:trackColorActive="?attr/colorPrimary"
                    app:trackColorInactive="@color/grey_60"
                    app:trackHeight="2dp" />

            </FrameLayout>

        </FrameLayout>

        <FrameLayout
            android:id="@+id/novelReaderBottomCont"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_gravity="bottom"
            android:layout_marginBottom="-48dp">

            <ImageView
                android:id="@+id/imageView3"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:srcCompat="@drawable/linear_gradient_black"
                tools:ignore="ContentDescription" />

            <ImageView
                android:id="@+id/imageView4"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                app:srcCompat="@drawable/linear_gradient_black"
                tools:ignore="ContentDescription" />

            <LinearLayout
                android:id="@+id/novelReaderBottomLayout"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginTop="24dp"
                android:layout_marginBottom="8dp"
                android:orientation="horizontal"
                android:padding="8dp">

                <androidx.cardview.widget.CardView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:cardBackgroundColor="#00FFFFFF"
                    app:cardCornerRadius="16dp"
                    app:cardElevation="0dp">

                    <ImageButton
                        android:id="@+id/novelReaderPreviousChapter"
                        style="@style/ExoMediaButton.Pause"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:contentDescription="@string/previous"
                        android:scaleX="1.5"
                        android:scaleY="1.5"
                        android:src="@drawable/ic_round_skip_previous_24"
                        tools:ignore="DuplicateSpeakableTextCheck,ImageContrastCheck" />

                </androidx.cardview.widget.CardView>

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

                    <TextView
                        android:id="@+id/novelReaderPrevChap"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:ellipsize="end"
                        android:fontFamily="@font/poppins_bold"
                        android:maxLines="1"
                        android:textColor="#fff"
                        tools:ignore="NestedWeights" />
                </LinearLayout>

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

                    <TextView
                        android:id="@+id/novelReaderNextChap"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:elegantTextHeight="true"
                        android:ellipsize="end"
                        android:fontFamily="@font/poppins_bold"
                        android:maxLines="1"
                        android:textAlignment="viewEnd"
                        android:textColor="#fff"
                        tools:ignore="NestedWeights"
                        tools:text="Chapter 200" />
                </LinearLayout>

                <androidx.cardview.widget.CardView
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    app:cardBackgroundColor="#00FFFFFF"
                    app:cardCornerRadius="16dp"
                    app:cardElevation="0dp">

                    <ImageButton
                        android:id="@+id/novelReaderNextChapter"
                        style="@style/ExoMediaButton.Pause"
                        android:layout_width="48dp"
                        android:layout_height="48dp"
                        android:layout_weight="1"
                        android:contentDescription="@string/next"
                        android:scaleX="1.5"
                        android:scaleY="1.5"
                        android:src="@drawable/ic_round_skip_next_24"
                        tools:ignore="ImageContrastCheck,DuplicateSpeakableTextCheck" />
                </androidx.cardview.widget.CardView>
            </LinearLayout>
        </FrameLayout>
    </LinearLayout>

    <ProgressBar
        android:id="@+id/progress"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center" />
</FrameLayout>
