优化搜索

pull/737/head
gedoor 4 years ago
parent 4ddf6599aa
commit 883fa65263
  1. 14
      app/src/main/java/io/legado/app/ui/book/search/SearchAdapter.kt

@ -40,15 +40,16 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
override fun getChangePayload(oldItem: SearchBook, newItem: SearchBook): Any? {
val payload = Bundle()
if (oldItem.name != newItem.name) payload.putString("name", newItem.name)
if (oldItem.author != newItem.author) payload.putString("author", newItem.author)
if (oldItem.origins.size != newItem.origins.size)
payload.putInt("origins", newItem.origins.size)
if (oldItem.coverUrl != newItem.coverUrl) payload.putString("cover", newItem.coverUrl)
if (oldItem.kind != newItem.kind) payload.putString("kind", newItem.kind)
if (oldItem.coverUrl != newItem.coverUrl)
payload.putString("cover", newItem.coverUrl)
if (oldItem.kind != newItem.kind)
payload.putString("kind", newItem.kind)
if (oldItem.latestChapterTitle != newItem.latestChapterTitle)
payload.putString("last", newItem.latestChapterTitle)
if (oldItem.intro != newItem.intro) payload.putString("intro", newItem.intro)
if (oldItem.intro != newItem.intro)
payload.putString("intro", newItem.intro)
if (payload.isEmpty) return null
return payload
}
@ -106,9 +107,6 @@ class SearchAdapter(context: Context, val callBack: CallBack) :
with(binding) {
bundle.keySet().map {
when (it) {
"name" -> tvName.text = searchBook.name
"author" -> tvAuthor.text =
context.getString(R.string.author_show, searchBook.author)
"origins" -> bvOriginCount.setBadgeCount(searchBook.origins.size)
"last" -> upLasted(binding, searchBook.latestChapterTitle)
"intro" -> {

Loading…
Cancel
Save