From 9729b111b3b6505d5883909725ac6a8f7d90440d Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 29 Nov 2019 15:49:41 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/book/info/BookInfoActivity.kt | 3 --- .../java/io/legado/app/ui/book/read/ReadBookActivity.kt | 3 --- .../io/legado/app/ui/changesource/ChangeSourceAdapter.kt | 4 ++-- .../io/legado/app/ui/changesource/ChangeSourceDialog.kt | 6 ++---- 4 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 59d534811..d7cd4637d 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -225,9 +225,6 @@ class BookInfoActivity : VMBaseActivity(R.layout.activity_boo } } - override val curOrigin: String? - get() = viewModel.bookData.value?.origin - override val oldBook: Book? get() = viewModel.bookData.value diff --git a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt index fa6dd44eb..de8efea60 100644 --- a/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/read/ReadBookActivity.kt @@ -330,9 +330,6 @@ class ReadBookActivity : VMBaseActivity(R.layout.activity_boo return ReadBook.chapterSize } - override val curOrigin: String? - get() = ReadBook.book?.origin - override val oldBook: Book? get() = ReadBook.book diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt index 763574810..b9292cace 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceAdapter.kt @@ -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 } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt index 038311a37..e25f2ef73 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceDialog.kt @@ -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) }