mirror of
https://github.com/gedoor/legado.git
synced 2025-08-10 00:52:30 +00:00
优化
This commit is contained in:
@@ -3,6 +3,7 @@ package io.legado.app.ui.book.search
|
||||
import android.content.Context
|
||||
import android.os.Bundle
|
||||
import android.view.ViewGroup
|
||||
import androidx.core.view.isVisible
|
||||
import androidx.recyclerview.widget.DiffUtil
|
||||
import io.legado.app.R
|
||||
import io.legado.app.base.adapter.DiffRecyclerAdapter
|
||||
@@ -78,6 +79,8 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
|
||||
binding.run {
|
||||
tvName.text = searchBook.name
|
||||
tvAuthor.text = context.getString(R.string.author_show, searchBook.author)
|
||||
ivInBookshelf.isVisible =
|
||||
callBack.isInBookshelf(searchBook.name, searchBook.author)
|
||||
bvOriginCount.setBadgeCount(searchBook.origins.size)
|
||||
upLasted(binding, searchBook.latestChapterTitle)
|
||||
tvIntroduce.text = searchBook.trimIntro(context)
|
||||
@@ -100,7 +103,7 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
|
||||
"last" -> upLasted(binding, searchBook.latestChapterTitle)
|
||||
"intro" -> tvIntroduce.text = searchBook.trimIntro(context)
|
||||
"kind" -> upKind(binding, searchBook.getKindList())
|
||||
"isInBookshelf" -> // todo 添加标志view
|
||||
"isInBookshelf" -> ivInBookshelf.isVisible =
|
||||
callBack.isInBookshelf(searchBook.name, searchBook.author)
|
||||
"cover" -> ivCover.load(
|
||||
searchBook.coverUrl,
|
||||
|
||||
@@ -13,6 +13,9 @@ import androidx.annotation.IntDef
|
||||
import io.legado.app.R
|
||||
import io.legado.app.lib.theme.accentColor
|
||||
|
||||
/**
|
||||
* 斜角标签
|
||||
*/
|
||||
@Suppress("unused")
|
||||
class BevelLabelView @JvmOverloads constructor(
|
||||
context: Context,
|
||||
|
||||
@@ -19,6 +19,16 @@
|
||||
app:layout_constraintTop_toTopOf="parent"
|
||||
tools:ignore="UnusedAttribute" />
|
||||
|
||||
<io.legado.app.ui.widget.image.CircleImageView
|
||||
android:id="@+id/iv_in_bookshelf"
|
||||
android:layout_width="8dp"
|
||||
android:layout_height="8dp"
|
||||
android:layout_margin="8dp"
|
||||
android:scaleType="centerCrop"
|
||||
android:src="@color/md_green_600"
|
||||
app:layout_constraintRight_toRightOf="@id/iv_cover"
|
||||
app:layout_constraintTop_toTopOf="@id/iv_cover" />
|
||||
|
||||
<io.legado.app.ui.widget.text.BadgeView
|
||||
android:id="@+id/bv_originCount"
|
||||
android:layout_width="wrap_content"
|
||||
|
||||
Reference in New Issue
Block a user