From b81650bf1f4b26f3b681a42901206548c87f6781 Mon Sep 17 00:00:00 2001 From: kunfei Date: Mon, 19 Aug 2019 14:18:53 +0800 Subject: [PATCH] up --- .../app/ui/changesource/ChangeSourceDialog.kt | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) 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 0fcd83683..a7d457c1f 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 @@ -78,17 +78,7 @@ class ChangeSourceDialog : DialogFragment(), private fun initRecyclerView() { changeSourceAdapter = ChangeSourceAdapter(requireContext()) - changeSourceAdapter.callBack = object : ChangeSourceAdapter.CallBack { - override fun changeTo(searchBook: SearchBook) { - callBack?.changeTo(searchBook.toBook()) - dismiss() - } - - override fun curBookUrl(): String { - return viewModel.curBookUrl - } - - } + changeSourceAdapter.callBack = this recycler_view.layoutManager = LinearLayoutManager(context) recycler_view.addItemDecoration(DividerItemDecoration(requireContext(), LinearLayout.VERTICAL)) recycler_view.adapter = changeSourceAdapter @@ -120,6 +110,7 @@ class ChangeSourceDialog : DialogFragment(), override fun changeTo(searchBook: SearchBook) { callBack?.changeTo(searchBook.toBook()) + dismiss() } override fun curBookUrl(): String {