pull/49/head
kunfei 5 years ago
parent e565085979
commit 9729b111b3
  1. 3
      app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt
  2. 3
      app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt
  3. 4
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt
  4. 6
      app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt

@ -225,9 +225,6 @@ class BookInfoActivity : VMBaseActivity<BookInfoViewModel>(R.layout.activity_boo
}
}
override val curOrigin: String?
get() = viewModel.bookData.value?.origin
override val oldBook: Book?
get() = viewModel.bookData.value

@ -330,9 +330,6 @@ class ReadBookActivity : VMBaseActivity<ReadBookViewModel>(R.layout.activity_boo
return ReadBook.chapterSize
}
override val curOrigin: String?
get() = ReadBook.book?.origin
override val oldBook: Book?
get() = ReadBook.book

@ -20,7 +20,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) :
this.onClick { callBack.changeTo(item) }
tv_origin.text = item.originName
tv_last.text = item.latestChapterTitle
if (callBack.curOrigin() == item.origin) {
if (callBack.bookUrl == item.bookUrl) {
iv_checked.visible()
} else {
iv_checked.invisible()
@ -33,7 +33,7 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) :
}
interface CallBack {
val bookUrl: String?
fun changeTo(searchBook: SearchBook)
fun curOrigin(): String
}
}

@ -135,16 +135,14 @@ class ChangeSourceDialog : DialogFragment(),
dismiss()
}
override fun curOrigin(): String {
return callBack?.curOrigin ?: ""
}
override val bookUrl: String?
get() = callBack?.oldBook?.bookUrl
override fun adapter(): ChangeSourceAdapter {
return changeSourceAdapter
}
interface CallBack {
val curOrigin: String?
val oldBook: Book?
fun changeTo(book: Book)
}

Loading…
Cancel
Save