From a99292a44db460a5351da412e4315459b762bde2 Mon Sep 17 00:00:00 2001 From: gedoor Date: Sun, 1 Nov 2020 11:34:21 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/book/arrange/ArrangeBookActivity.kt | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt index af949ce68..a1f64b9a4 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt @@ -32,7 +32,9 @@ import kotlinx.android.synthetic.main.activity_arrange_book.* class ArrangeBookActivity : VMBaseActivity(R.layout.activity_arrange_book), PopupMenu.OnMenuItemClickListener, - ArrangeBookAdapter.CallBack, GroupSelectDialog.CallBack { + SelectActionBar.CallBack, + ArrangeBookAdapter.CallBack, + GroupSelectDialog.CallBack { override val viewModel: ArrangeBookViewModel get() = getViewModel(ArrangeBookViewModel::class.java) override val groupList: ArrayList = arrayListOf() @@ -63,6 +65,18 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi return super.onPrepareOptionsMenu(menu) } + override fun selectAll(selectAll: Boolean) { + adapter.selectAll(selectAll) + } + + override fun revertSelection() { + adapter.revertSelection() + } + + override fun onClickMainAction() { + selectGroup(groupRequestCode, 0) + } + private fun initView() { ATH.applyEdgeEffectColor(recycler_view) recycler_view.layoutManager = LinearLayoutManager(this) @@ -81,19 +95,7 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi select_action_bar.setMainActionText(R.string.move_to_group) select_action_bar.inflateMenu(R.menu.arrange_book_sel) select_action_bar.setOnMenuItemClickListener(this) - select_action_bar.setCallBack(object : SelectActionBar.CallBack { - override fun selectAll(selectAll: Boolean) { - adapter.selectAll(selectAll) - } - - override fun revertSelection() { - adapter.revertSelection() - } - - override fun onClickMainAction() { - selectGroup(groupRequestCode, 0) - } - }) + select_action_bar.setCallBack(this) } private fun initGroupData() {