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 0231a4cea..763574810 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.curBookUrl() == item.bookUrl) { + if (callBack.curOrigin() == item.origin) { iv_checked.visible() } else { iv_checked.invisible() @@ -34,6 +34,6 @@ class ChangeSourceAdapter(context: Context, val callBack: CallBack) : interface CallBack { fun changeTo(searchBook: SearchBook) - fun curBookUrl(): String + 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 cb13679fe..0509ba52e 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 @@ -24,12 +24,12 @@ class ChangeSourceDialog : DialogFragment(), companion object { const val tag = "changeSourceDialog" - fun newInstance(name: String, author: String, bookUrl: String? = null): ChangeSourceDialog { + fun newInstance(name: String, author: String, origin: String): ChangeSourceDialog { val changeSourceDialog = ChangeSourceDialog() val bundle = Bundle() bundle.putString("name", name) bundle.putString("author", author) - bundle.putString("bookUrl", bookUrl) + bundle.putString("origin", origin) changeSourceDialog.arguments = bundle return changeSourceDialog } @@ -53,8 +53,8 @@ class ChangeSourceDialog : DialogFragment(), bundle.getString("author")?.let { viewModel.author = it } - bundle.getString("bookUrl")?.let { - viewModel.curBookUrl = it + bundle.getString("origin")?.let { + viewModel.curOrigin = it } } tool_bar.inflateMenu(R.menu.search_view) @@ -127,8 +127,8 @@ class ChangeSourceDialog : DialogFragment(), dismiss() } - override fun curBookUrl(): String { - return viewModel.curBookUrl + override fun curOrigin(): String { + return viewModel.curOrigin } override fun adapter(): ChangeSourceAdapter { diff --git a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt index 2cf667a29..acfba1ce3 100644 --- a/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt +++ b/app/src/main/java/io/legado/app/ui/changesource/ChangeSourceViewModel.kt @@ -16,7 +16,7 @@ import org.jetbrains.anko.debug class ChangeSourceViewModel(application: Application) : BaseViewModel(application) { var callBack: CallBack? = null - var curBookUrl = "" + var curOrigin = "" var name: String = "" var author: String = "" var screenKey: String = ""