Files
QieKan-3.0/app/src/main/res/layout/item_search.xml
T

159 lines
6.1 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="wrap_content"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:paddingHorizontal="16dp"
android:paddingVertical="8dp"
android:background="?attr/selectableItemBackground"
android:orientation="horizontal"
android:scrollbars="none">
<!-- 封面图片 -->
<com.google.android.material.card.MaterialCardView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:cardCornerRadius="8dp"
app:strokeWidth="0dp">
<io.legato.kazusa.ui.widget.image.CoverImageView
android:id="@+id/iv_cover"
android:layout_width="80dp"
android:layout_height="110dp"
android:contentDescription="@string/img_cover"
android:scaleType="centerCrop"
android:src="@drawable/image_cover_default"
android:transitionName="img_cover"
tools:ignore="UnusedAttribute" />
<!-- 书架内标记 -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/iv_in_bookshelf"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentStart="true"
android:layout_centerVertical="true"
android:layout_margin="4dp"
android:scaleType="centerCrop"
android:visibility="visible"
app:cardBackgroundColor="?attr/colorTertiaryContainer"
app:cardCornerRadius="4dp"
app:strokeWidth="0dp">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4dp"
android:paddingVertical="2dp"
android:text="@string/remove_from_bookshelf"
android:textColor="?attr/colorTertiary"
android:textStyle="bold"
android:textSize="10sp"
tools:ignore="SmallSp" />
</com.google.android.material.card.MaterialCardView>
</com.google.android.material.card.MaterialCardView>
<!-- 右侧内容区域 -->
<LinearLayout
android:layout_width="0dp"
android:layout_height="match_parent"
android:layout_weight="1"
android:layout_marginStart="8dp"
android:layout_gravity="center"
android:orientation="vertical">
<!-- 标题行 -->
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<TextView
android:id="@+id/tv_name"
style="@style/ChapterNameText"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_marginEnd="4dp"
android:singleLine="true"
android:text="@string/app_name"
app:layout_constraintEnd_toStartOf="@id/cd_count"
app:layout_constraintHorizontal_bias="0.0"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<com.google.android.material.card.MaterialCardView
android:id="@+id/cd_count"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:visibility="gone"
android:layout_marginVertical="4dp"
app:cardBackgroundColor="?attr/colorSurfaceContainer"
app:cardCornerRadius="4dp"
app:layout_constraintBottom_toBottomOf="@id/tv_name"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="@id/tv_name"
app:strokeWidth="0dp">
<TextView
android:id="@+id/bv_originCount"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingHorizontal="4dp"
android:paddingVertical="2dp"
android:text="@string/text"
android:textColor="?attr/colorPrimary"
android:textSize="10sp"
android:textStyle="bold"
tools:ignore="SmallSp" />
</com.google.android.material.card.MaterialCardView>
</androidx.constraintlayout.widget.ConstraintLayout>
<!-- 作者 -->
<TextView
android:id="@+id/tv_author"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:text="@string/author"
android:textSize="12sp" />
<!-- 分类标签 -->
<HorizontalScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:scrollbars="none">
<io.legato.kazusa.ui.widget.LabelsBar
android:id="@+id/ll_kind"
android:layout_width="wrap_content"
android:layout_height="40dp"
app:chipSpacingHorizontal="4dp"
android:orientation="horizontal" />
</HorizontalScrollView>
<!-- 最后阅读 -->
<TextView
android:id="@+id/tv_lasted"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:lines="1"
android:text="@string/last_read"
android:textSize="12sp" />
<!-- 简介 -->
<io.legato.kazusa.ui.widget.text.MultilineTextView
android:id="@+id/tv_introduce"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:ellipsize="end"
android:text="@string/book_intro"
android:textSize="12sp" />
</LinearLayout>
</LinearLayout>