<?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
  -->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:orientation="vertical"
    android:layout_marginBottom="15dp"
    android:paddingHorizontal="15dp">

    <RelativeLayout
        android:id="@+id/rl_book_detail"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:paddingVertical="10dp">

        <LinearLayout
            android:id="@+id/ll_book_item"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:padding="5dp">

            <xyz.fycz.myreader.widget.CoverImageView
                android:id="@+id/iv_book_img"
                android:layout_width="40dp"
                android:layout_height="55dp"
                android:scaleType="fitXY"
                app:srcCompat="@mipmap/default_cover" />

            <LinearLayout
                android:id="@+id/ll_book_read"
                android:paddingHorizontal="5dp"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:orientation="vertical">

                <TextView
                    android:id="@+id/tv_book_name"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:maxLines="1"
                    android:padding="4dp"
                    android:text="@string/app_name"
                    android:textColor="@color/textPrimary"
                    android:textSize="@dimen/text_normal_size" />

                <TextView
                    android:id="@+id/tv_book_author"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:maxLines="1"
                    android:padding="4dp"
                    android:text="@string/app_name"
                    android:textColor="@color/textSecondary"
                    android:textSize="@dimen/text_default_size" />

            </LinearLayout>
        </LinearLayout>


        <TextView
            android:id="@+id/tv_theme_mode_select"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_alignParentEnd="true"
            android:layout_centerVertical="true"
            android:layout_marginEnd="5dp"
            android:background="@drawable/shape_runway"
            android:paddingHorizontal="10dp"
            android:paddingVertical="5dp"
            android:text="详情"
            android:textColor="@color/textPrimary"
            android:textSize="@dimen/text_small_size" />
    </RelativeLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/sys_window_back" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:layout_marginVertical="5dp"
        android:paddingVertical="5dp">

        <TextView
            android:id="@+id/tv_top"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_book_Top"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_top" />
        <LinearLayout
            android:layout_width="0dp"
            android:layout_height="match_parent"
            android:layout_weight="1"
            android:orientation="vertical">

            <xyz.fycz.myreader.widget.SwitchButton
                android:id="@+id/sb_is_update"
                android:layout_width="48dp"
                android:layout_height="28dp"
                app:sb_checked_color="@color/colorAccent"
                android:layout_gravity="center_horizontal" />

            <TextView
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:textColor="@color/textPrimary"
                android:textSize="@dimen/text_small_size"
                android:text="@string/menu_is_update"/>
        </LinearLayout>
        <TextView
            android:id="@+id/tv_download"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_book_download"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_download" />

        <TextView
            android:id="@+id/tv_export_cathe"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_book_cache"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_export" />

    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/sys_window_back" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_marginVertical="5dp"

        android:layout_height="55dp"
        android:paddingVertical="5dp">

        <TextView
            android:id="@+id/tv_change_source"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_change_source"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_change" />

        <TextView
            android:id="@+id/tv_set_group"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_group_setting"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_group" />

        <TextView
            android:id="@+id/tv_share"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_share"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_share" />

        <TextView
            android:id="@+id/tv_remove"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_book_delete"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_delete" />
    </LinearLayout>

    <View
        android:layout_width="match_parent"
        android:layout_height="0.5dp"
        android:background="@color/sys_window_back" />

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="55dp"
        android:layout_marginVertical="5dp"

        android:paddingVertical="5dp">

        <TextView
            android:id="@+id/tv_edit"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_edit"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_edit" />

        <TextView
            android:id="@+id/tv_refresh"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/refresh_books"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_refresh" />

        <TextView
            android:id="@+id/tv_link"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/menu_open_link"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_link" />

        <TextView
            android:id="@+id/tv_edit_source"
            style="@style/MAppTheme.TextAppearance.BookMenu"
            android:clickable="true"
            android:focusable="true"
            android:text="@string/book_source"
            app:drawableTint="@color/textPrimary"
            app:drawableTopCompat="@drawable/ic_source" />
    </LinearLayout>
</LinearLayout>