pull/32/head
kunfei 5 years ago
parent 359d11bf60
commit 4ebe82ca03
  1. 3
      app/src/main/java/io/legado/app/ui/search/SearchAdapter.kt
  2. 26
      app/src/main/res/layout/item_search.xml

@ -49,7 +49,8 @@ class SearchAdapter : PagedListAdapter<SearchBook, SearchAdapter.MyViewHolder>(D
class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) { class MyViewHolder(view: View) : RecyclerView.ViewHolder(view) {
fun bind(searchBook: SearchBook, callBack: CallBack?) = with(itemView) { fun bind(searchBook: SearchBook, callBack: CallBack?) = with(itemView) {
tv_name.text = String.format("%s(%s)", searchBook.name, searchBook.author) tv_name.text = searchBook.name
tv_author.text = searchBook.author
tv_lasted.text = context.getString(R.string.book_search_last, searchBook.latestChapterTitle) tv_lasted.text = context.getString(R.string.book_search_last, searchBook.latestChapterTitle)
tv_introduce.text = searchBook.intro tv_introduce.text = searchBook.intro
val kinds = searchBook.getKindList() val kinds = searchBook.getKindList()

@ -39,6 +39,16 @@
app:layout_constraintRight_toRightOf="@id/tv_name" app:layout_constraintRight_toRightOf="@id/tv_name"
app:layout_constraintTop_toBottomOf="@+id/tv_name"> app:layout_constraintTop_toBottomOf="@+id/tv_name">
<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:textColor="@color/tv_text_default"
android:textSize="12sp" />
<LinearLayout <LinearLayout
android:id="@+id/ll_kind" android:id="@+id/ll_kind"
android:layout_width="match_parent" android:layout_width="match_parent"
@ -53,7 +63,8 @@
android:paddingLeft="3dp" android:paddingLeft="3dp"
android:paddingRight="3dp" android:paddingRight="3dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name"
android:textSize="12sp" />
<io.legado.app.lib.theme.view.ATEAccentBgTextView <io.legado.app.lib.theme.view.ATEAccentBgTextView
android:id="@+id/tv_kind_1" android:id="@+id/tv_kind_1"
@ -63,7 +74,8 @@
android:paddingLeft="3dp" android:paddingLeft="3dp"
android:paddingRight="3dp" android:paddingRight="3dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name"
android:textSize="12sp" />
<io.legado.app.lib.theme.view.ATEAccentBgTextView <io.legado.app.lib.theme.view.ATEAccentBgTextView
android:id="@+id/tv_kind_2" android:id="@+id/tv_kind_2"
@ -73,18 +85,18 @@
android:paddingLeft="3dp" android:paddingLeft="3dp"
android:paddingRight="3dp" android:paddingRight="3dp"
android:singleLine="true" android:singleLine="true"
android:text="@string/app_name" /> android:text="@string/app_name"
android:textSize="12sp" />
</LinearLayout> </LinearLayout>
<TextView <TextView
android:id="@+id/tv_lasted" android:id="@+id/tv_lasted"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="0dp" android:layout_height="wrap_content"
android:layout_weight="1"
android:ellipsize="end" android:ellipsize="end"
android:lines="1" android:lines="1"
android:text="最新章节" android:text="@string/last_read"
android:textColor="@color/tv_text_default" android:textColor="@color/tv_text_default"
android:textSize="12sp" /> android:textSize="12sp" />
@ -93,7 +105,7 @@
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:ellipsize="end" android:ellipsize="end"
android:text="简介" android:text="@string/book_intro"
android:textColor="@color/tv_text_default" android:textColor="@color/tv_text_default"
android:textSize="12sp" /> android:textSize="12sp" />

Loading…
Cancel
Save