|
|
@ -78,17 +78,7 @@ class ChangeSourceDialog : DialogFragment(), |
|
|
|
|
|
|
|
|
|
|
|
private fun initRecyclerView() { |
|
|
|
private fun initRecyclerView() { |
|
|
|
changeSourceAdapter = ChangeSourceAdapter(requireContext()) |
|
|
|
changeSourceAdapter = ChangeSourceAdapter(requireContext()) |
|
|
|
changeSourceAdapter.callBack = object : ChangeSourceAdapter.CallBack { |
|
|
|
changeSourceAdapter.callBack = this |
|
|
|
override fun changeTo(searchBook: SearchBook) { |
|
|
|
|
|
|
|
callBack?.changeTo(searchBook.toBook()) |
|
|
|
|
|
|
|
dismiss() |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
override fun curBookUrl(): String { |
|
|
|
|
|
|
|
return viewModel.curBookUrl |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
recycler_view.layoutManager = LinearLayoutManager(context) |
|
|
|
recycler_view.layoutManager = LinearLayoutManager(context) |
|
|
|
recycler_view.addItemDecoration(DividerItemDecoration(requireContext(), LinearLayout.VERTICAL)) |
|
|
|
recycler_view.addItemDecoration(DividerItemDecoration(requireContext(), LinearLayout.VERTICAL)) |
|
|
|
recycler_view.adapter = changeSourceAdapter |
|
|
|
recycler_view.adapter = changeSourceAdapter |
|
|
@ -120,6 +110,7 @@ class ChangeSourceDialog : DialogFragment(), |
|
|
|
|
|
|
|
|
|
|
|
override fun changeTo(searchBook: SearchBook) { |
|
|
|
override fun changeTo(searchBook: SearchBook) { |
|
|
|
callBack?.changeTo(searchBook.toBook()) |
|
|
|
callBack?.changeTo(searchBook.toBook()) |
|
|
|
|
|
|
|
dismiss() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
override fun curBookUrl(): String { |
|
|
|
override fun curBookUrl(): String { |
|
|
|