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 b5d0e565a..0fcd83683 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 @@ -17,7 +17,9 @@ import io.legado.app.utils.getViewModel import kotlinx.android.synthetic.main.dialog_change_source.* -class ChangeSourceDialog : DialogFragment(), ChangeSourceViewModel.CallBack { +class ChangeSourceDialog : DialogFragment(), + ChangeSourceViewModel.CallBack, + ChangeSourceAdapter.CallBack { companion object { const val tag = "changeSourceDialog" @@ -116,6 +118,14 @@ class ChangeSourceDialog : DialogFragment(), ChangeSourceViewModel.CallBack { }) } + override fun changeTo(searchBook: SearchBook) { + callBack?.changeTo(searchBook.toBook()) + } + + override fun curBookUrl(): String { + return viewModel.curBookUrl + } + override fun adapter(): ChangeSourceAdapter { return changeSourceAdapter }