<?xml version="1.0" encoding="utf-8"?>
<!--
  ~ This file is part of FYReader.
  ~  FYReader is free software: you can redistribute it and/or modify
  ~  it under the terms of the GNU General Public License as published by
  ~  the Free Software Foundation, either version 3 of the License, or
  ~  (at your option) any later version.
  ~
  ~  FYReader is distributed in the hope that it will be useful,
  ~  but WITHOUT ANY WARRANTY; without even the implied warranty of
  ~  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  ~  GNU General Public License for more details.
  ~
  ~  You should have received a copy of the GNU General Public License
  ~  along with FYReader.  If not, see <https://www.gnu.org/licenses/>.
  ~
  ~  Copyright (C) 2020 - 2022 fengyuecanzhu
  -->

<RelativeLayout
    android:id="@+id/rl_content"
    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">

    <com.google.android.material.appbar.AppBarLayout
        android:id="@+id/read_abl_top_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@color/read_menu_bg"
        android:visibility="gone"
        tools:visibility="visible">

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

            <androidx.appcompat.widget.Toolbar
                android:id="@+id/toolbar"
                style="@style/NoPaddingToolbar"
                android:layout_width="match_parent"
                android:layout_height="45dp"
                android:gravity="center_vertical"
                android:minHeight="?attr/actionBarSize"
                android:theme="?attr/actionBarStyle"
                android:transitionName="sharedView"
                app:layout_scrollFlags="scroll|enterAlways"
                app:popupTheme="@style/AppTheme.PopupOverlay"
                app:title="大主宰" />

            <View
                android:layout_width="fill_parent"
                android:layout_height="0.5dp"
                android:background="@color/sys_dialog_setting_line" />

            <LinearLayout
                android:id="@+id/ll_chapter_view"
                android:layout_width="match_parent"
                android:layout_height="40dp"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tv_chapter_title_top"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="14dp"
                    android:layout_marginEnd="14dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="章节名称"
                    android:textColor="@color/read_menu_text"
                    android:textSize="15sp" />

                <TextView
                    android:id="@+id/tv_chapter_url"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginStart="14dp"
                    android:layout_marginEnd="14dp"
                    android:ellipsize="end"
                    android:maxLines="1"
                    android:text="章节链接"
                    android:textColor="@color/read_menu_text"
                    android:textSize="13sp" />
            </LinearLayout>
        </LinearLayout>
    </com.google.android.material.appbar.AppBarLayout>

    <!--阅读页面-->
    <xyz.fycz.myreader.widget.page.PageView
        android:id="@+id/read_pv_content"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:clickable="true"
        tools:visibility="gone"
        android:focusable="true" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/cursor_left"
        android:tag="left"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@null"
        app:tint="@color/colorAccent"
        app:srcCompat="@drawable/ic_cursor_left"
        android:visibility="invisible" />

    <androidx.appcompat.widget.AppCompatImageView
        android:id="@+id/cursor_right"
        android:tag="right"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:contentDescription="@null"
        app:tint="@color/colorAccent"
        app:srcCompat="@drawable/ic_cursor_right"
        android:visibility="invisible" />
    <!--底部页面-->
    <LinearLayout
        android:id="@+id/read_ll_bottom_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:clickable="true"
        android:orientation="vertical"
        android:visibility="gone"
        tools:visibility="visible"
        android:focusable="true">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content">
            <!--切换页面提示-->
            <TextView
                android:id="@+id/read_tv_page_tip"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:layout_marginTop="4dp"
                android:layout_marginBottom="10dp"
                android:background="@color/read_menu_bg"
                android:gravity="center"
                android:paddingLeft="12dp"
                android:paddingTop="8dp"
                android:paddingRight="12dp"
                android:paddingBottom="8dp"
                android:text="1/12"
                android:textColor="@color/md_white_1000" />

            <com.google.android.material.floatingactionbutton.FloatingActionButton
                android:id="@+id/btn_night_mode"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_alignParentEnd="true"
                android:layout_marginEnd="15dp"
                android:layout_marginBottom="12dp"
                android:src="@drawable/ic_night_mode"
                android:tint="@drawable/setting_btn_bg_color"
                app:backgroundTint="@color/read_menu_bg"
                app:elevation="2dp"
                app:fabCustomSize="40dp"
                app:pressedTranslationZ="2dp" />
        </RelativeLayout>

        <!--页面进度栏-->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="60dp"
            android:background="@color/read_menu_bg"
            android:gravity="center_vertical"
            android:orientation="horizontal">

            <TextView
                android:id="@+id/read_tv_pre_chapter"
                style="@style/MAppTheme.TextAppearance.Read.BottomMenu"
                android:layout_width="80dp"
                android:layout_height="match_parent"
                android:clickable="true"
                android:focusable="true"
                android:gravity="center"
                android:text="上一章" />

            <SeekBar
                android:id="@+id/read_sb_chapter_progress"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:max="100"
                android:maxHeight="3dp"
                android:minHeight="3dp"
                android:progressDrawable="@drawable/seekbar_bg"
                android:thumb="@mipmap/thumb"
                android:thumbOffset="10dp" />

            <TextView
                android:id="@+id/read_tv_next_chapter"
                style="@style/MAppTheme.TextAppearance.Read.BottomMenu"
                android:layout_width="80dp"
                android:layout_height="match_parent"
                android:clickable="true"
                android:focusable="true"
                android:gravity="center"
                android:text="下一章" />
        </LinearLayout>

        <View
            android:layout_width="fill_parent"
            android:layout_height="0.5dp"
            android:background="@color/sys_dialog_setting_line" />
        <!--菜单栏-->
        <LinearLayout
            android:layout_width="match_parent"
            android:layout_height="72dp"
            android:background="@color/read_menu_bg"
            android:orientation="horizontal"
            android:paddingTop="12dp"
            android:paddingBottom="12dp">

            <TextView
                android:id="@+id/read_tv_category"
                style="@style/AppTheme.TextAppearance.Read.BottomMenu.Button"
                android:clickable="true"
                android:focusable="true"
                android:text="目录"
                app:drawableTint="@drawable/setting_btn_bg_color"
                app:drawableTopCompat="@drawable/ic_catalog" />

            <TextView
                android:id="@+id/read_tv_listen_book"
                style="@style/AppTheme.TextAppearance.Read.BottomMenu.Button"
                android:clickable="true"
                android:focusable="true"
                android:text="语音朗读"
                app:drawableTint="@drawable/setting_btn_bg_color"
                app:drawableTopCompat="@drawable/ic_listen_book" />

            <TextView
                android:id="@+id/read_tv_brightness_eye"
                style="@style/AppTheme.TextAppearance.Read.BottomMenu.Button"
                android:clickable="true"
                android:focusable="true"
                android:text="亮度/护眼"
                app:drawableTint="@drawable/setting_btn_bg_color"
                app:drawableTopCompat="@drawable/ic_sun" />

            <TextView
                android:id="@+id/read_tv_setting"
                style="@style/AppTheme.TextAppearance.Read.BottomMenu.Button"
                android:clickable="true"
                android:focusable="true"
                android:text="设置"
                app:drawableTint="@drawable/setting_btn_bg_color"
                app:drawableTopCompat="@drawable/ic_aa" />
        </LinearLayout>
        <View
            android:id="@+id/vwNavigationBar"
            android:layout_width="match_parent"
            android:layout_height="0dp"
            android:background="@color/read_menu_bg" />
    </LinearLayout>

    <xyz.fycz.myreader.ui.popmenu.ReadSettingMenu
        android:id="@+id/read_setting_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="invisible" />

    <xyz.fycz.myreader.ui.popmenu.CustomizeComMenu
        android:id="@+id/read_customize_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="invisible" />

    <xyz.fycz.myreader.ui.popmenu.AutoPageMenu
        android:id="@+id/read_auto_page_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="invisible" />

    <xyz.fycz.myreader.ui.popmenu.CustomizeLayoutMenu
        android:id="@+id/read_customize_layout_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="invisible" />

    <xyz.fycz.myreader.ui.popmenu.BrightnessEyeMenu
        android:id="@+id/read_brightness_eye_menu"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:layout_alignParentBottom="true"
        android:visibility="invisible" />
</RelativeLayout>
