fix: 换源界面

pull/95/head
kunfei 5 years ago
parent 20b0d6086a
commit 01d00bbba9
  1. 9
      app/src/main/java/io/legado/app/data/entities/SearchBook.kt
  2. 4
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt

@ -90,6 +90,15 @@ data class SearchBook(
origins?.add(origin) origins?.add(origin)
} }
fun getDisplayLastChapterTitle(): String {
latestChapterTitle?.let {
if (it.isNotEmpty()) {
return it
}
}
return "无最新章节"
}
fun toBook(): Book { fun toBook(): Book {
return Book( return Book(
name = name, name = name,

@ -19,7 +19,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) :
if (payloads.isEmpty()) { if (payloads.isEmpty()) {
this.onClick { callBack.changeTo(item) } this.onClick { callBack.changeTo(item) }
tv_origin.text = item.originName tv_origin.text = item.originName
tv_last.text = item.latestChapterTitle tv_last.text = item.getDisplayLastChapterTitle()
if (callBack.bookUrl == item.bookUrl) { if (callBack.bookUrl == item.bookUrl) {
iv_checked.visible() iv_checked.visible()
} else { } else {
@ -27,7 +27,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) :
} }
} else { } else {
tv_origin.text = item.originName tv_origin.text = item.originName
tv_last.text = item.latestChapterTitle tv_last.text = item.getDisplayLastChapterTitle()
} }
} }
} }

Loading…
Cancel
Save