Files
QieKan-3.0/app/src/main/res/layout/activity_book_info.xml
T
2025-06-04 13:33:51 +08:00

399 lines
20 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout 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">
<ImageView
android:id="@+id/bg_book"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:contentDescription="@string/bg_image"
android:foreground="@drawable/bg_book_mask"
android:scaleType="centerCrop" />
<com.google.android.material.appbar.AppBarLayout
android:id="@+id/app_bar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/transparent"
android:fitsSystemWindows="true">
<com.google.android.material.appbar.CollapsingToolbarLayout
android:layout_width="match_parent"
android:layout_height="?attr/collapsingToolbarLayoutLargeSize"
style="?attr/collapsingToolbarLayoutLargeSize"
app:collapsedTitleTextAppearance="?attr/textAppearanceTitleLarge"
app:expandedTitleTextAppearance="?attr/textAppearanceHeadlineLarge"
app:layout_scrollFlags="scroll|exitUntilCollapsed|snap">
<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/top_bar"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:navigationIcon="@drawable/ic_arrow_back"
app:title=" "
app:layout_collapseMode="pin" />
</com.google.android.material.appbar.CollapsingToolbarLayout>
</com.google.android.material.appbar.AppBarLayout>
<androidx.swiperefreshlayout.widget.SwipeRefreshLayout
android:id="@+id/refresh_layout"
android:layout_width="match_parent"
android:layout_height="match_parent"
app:layout_behavior="@string/appbar_scrolling_view_behavior">
<io.legato.kazusa.ui.widget.NoChildScrollNestedScrollView
android:id="@+id/scroll_view"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true"
android:fitsSystemWindows="false"
android:focusable="true"
android:padding="0dp"
android:scrollbarStyle="outsideOverlay"
android:scrollbars="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_gradient_mask"
android:paddingHorizontal="16dp"
android:paddingTop="8dp">
<androidx.cardview.widget.CardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp">
<io.legato.kazusa.ui.widget.image.CoverImageView
android:id="@+id/iv_cover"
android:layout_width="100dp"
android:layout_height="140dp"
android:contentDescription="@string/img_cover"
android:scaleType="centerCrop"
android:src="@drawable/image_cover_default" />
</androidx.cardview.widget.CardView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:orientation="vertical"
android:padding="12dp">
<TextView
android:id="@+id/tv_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxLines="2"
android:text="@string/book_name"
style="@style/TextAppearance.Material3.ActionBar.Title"
tools:ignore="RtlHardcoded" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:orientation="horizontal"
android:paddingTop="6dp"
android:paddingBottom="2dp"
tools:ignore="UseCompoundDrawables">
<ImageView
android:layout_width="18sp"
android:layout_height="18sp"
android:contentDescription="@string/author"
android:src="@drawable/ic_author"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_author"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:singleLine="true"
android:text="@string/author"
android:textSize="14sp"
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/iv_web"
android:layout_width="18sp"
android:layout_height="18sp"
android:contentDescription="@string/origin_format"
android:src="@drawable/ic_web_outline"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_origin"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="2dp"
android:ellipsize="end"
android:paddingRight="6dp"
android:singleLine="true"
android:textSize="14sp"
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
tools:text="@string/origin_format" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/ll_info"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/background_theme"
android:orientation="vertical"
android:padding="8dp">
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginStart="8dp"
android:scrollbars="none">
<io.legato.kazusa.ui.widget.LabelsBar
android:id="@+id/lb_kind"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone" />
</HorizontalScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingHorizontal="8dp"
android:paddingBottom="8dp">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:weightSum="4"
android:gravity="center_vertical">
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_shelf"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginEnd="6dp"
android:padding="8dp"
android:text="@string/remove_from_bookshelf"
android:textSize="13sp"
app:icon="@drawable/ic_clear_all"
app:iconGravity="top"
app:iconPadding="4dp"
app:iconSize="20dp" />
<!-- 查看目录按钮 -->
<com.google.android.material.button.MaterialButton
android:id="@+id/tv_toc_view"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:padding="8dp"
android:text="@string/view_toc"
android:textSize="13sp"
app:icon="@drawable/ic_toc"
app:iconGravity="top"
app:iconPadding="4dp"
app:iconSize="20dp" />
<!-- 更换分组按钮 -->
<com.google.android.material.button.MaterialButton
android:id="@+id/tv_change_group"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:padding="8dp"
android:text="@string/change_group"
android:textSize="13sp"
app:icon="@drawable/ic_groups"
app:iconGravity="top"
app:iconPadding="4dp"
app:iconSize="20dp" />
<!-- 更换来源按钮(保持原样) -->
<com.google.android.material.button.MaterialButton
android:id="@+id/btn_change_source"
style="@style/Widget.Material3.Button.TextButton"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:text="@string/book_source"
android:padding="8dp"
app:icon="@drawable/ic_change_source"
android:textSize="13sp"
app:iconGravity="top"
app:iconPadding="4dp"
app:iconSize="20dp"
tools:contentDescription="@string/change_origin" />
</LinearLayout>
<LinearLayout
android:id="@+id/ll_toc"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="4dp"
android:paddingBottom="4dp">
<ImageView
android:layout_width="18sp"
android:layout_height="18sp"
android:contentDescription="@string/read_dur_progress"
android:paddingRight="2dp"
android:src="@drawable/ic_chapter"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_toc"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:paddingRight="6dp"
android:textSize="14sp"
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
tools:text="@string/toc_s" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="3dp"
android:paddingBottom="3dp"
tools:ignore="UseCompoundDrawables">
<ImageView
android:id="@+id/ic_book_last"
android:layout_width="18sp"
android:layout_height="18sp"
android:contentDescription="@string/read_dur_progress"
android:paddingRight="2dp"
android:src="@drawable/ic_book_last"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_lasted"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:paddingRight="6dp"
android:singleLine="true"
android:textSize="14sp"
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
tools:text="@string/read_dur_progress" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal"
android:paddingTop="3dp"
android:paddingBottom="3dp">
<ImageView
android:layout_width="18sp"
android:layout_height="18sp"
android:contentDescription="@string/read_dur_progress"
android:paddingRight="2dp"
android:src="@drawable/ic_groups"
tools:ignore="RtlHardcoded,RtlSymmetry" />
<TextView
android:id="@+id/tv_group"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end"
android:includeFontPadding="false"
android:paddingRight="6dp"
android:singleLine="true"
android:textSize="14sp"
tools:ignore="NestedWeights,RtlHardcoded,RtlSymmetry"
tools:text="@string/group_s" />
</LinearLayout>
</LinearLayout>
<TextView
android:id="@+id/tv_detail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="8dp"
android:clickable="true"
android:focusable="true"
android:minHeight="48dp"
android:paddingLeft="8dp"
android:paddingBottom="8dp"
android:lineSpacingExtra="4dp"
android:text="@string/book_intro"
android:textIsSelectable="true"
android:textSize="14sp"
android:visibility="visible"
tools:ignore="RtlHardcoded,RtlSymmetry" />
</LinearLayout>
</LinearLayout>
</io.legato.kazusa.ui.widget.NoChildScrollNestedScrollView>
</androidx.swiperefreshlayout.widget.SwipeRefreshLayout>
<com.google.android.material.floatingactionbutton.ExtendedFloatingActionButton
android:id="@+id/btn_read"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="bottom|end"
android:layout_marginEnd="16dp"
android:layout_marginBottom="24dp"
android:text="@string/reading"
android:textColor="?attr/colorOnPrimary"
android:contentDescription="@string/reading"
app:iconGravity="textStart"
app:icon="@drawable/ic_bottom_books"
app:backgroundTint="?attr/colorSecondary"
app:iconTint="?attr/colorOnPrimary"
app:layout_behavior="com.google.android.material.behavior.HideBottomViewOnScrollBehavior" />
</androidx.coordinatorlayout.widget.CoordinatorLayout>