From f0b3f29575f1dccc7a4a372e9d0ec7853b20c1d2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Thu, 13 Feb 2020 18:46:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E4=BC=98=E5=8C=96=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/legado/app/ui/book/arrange/ArrangeBookActivity.kt | 6 +++--- .../io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt | 4 ++-- .../java/io/legado/app/ui/book/info/BookInfoActivity.kt | 4 +++- 3 files changed, 8 insertions(+), 6 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 e122baf1b..981e5d991 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 @@ -76,7 +76,7 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi } override fun onClickMainAction() { - selectGroup(groupRequestCode) + selectGroup(0, groupRequestCode) } }) } @@ -158,8 +158,8 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi } } - override fun selectGroup(requestCode: Int) { - GroupSelectDialog.show(supportFragmentManager, requestCode) + override fun selectGroup(groupId: Int, requestCode: Int) { + GroupSelectDialog.show(supportFragmentManager, groupId, requestCode) } override fun upGroup(requestCode: Int, group: BookGroup) { diff --git a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt index f0fe88f4f..7b3345917 100644 --- a/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookAdapter.kt @@ -68,7 +68,7 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : } tv_group.onClick { actionItem = item - callBack.selectGroup(groupRequestCode) + callBack.selectGroup(item.group, groupRequestCode) } } } @@ -86,6 +86,6 @@ class ArrangeBookAdapter(context: Context, val callBack: CallBack) : val groupList: List fun upSelectCount() fun deleteBook(book: Book) - fun selectGroup(requestCode: Int) + fun selectGroup(groupId: Int, requestCode: Int) } } \ No newline at end of file diff --git a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt index 987dceb78..779d8aa01 100644 --- a/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt +++ b/app/src/main/java/io/legado/app/ui/book/info/BookInfoActivity.kt @@ -237,7 +237,9 @@ class BookInfoActivity : } } tv_group.onClick { - GroupSelectDialog.show(supportFragmentManager) + viewModel.bookData.value?.let { + GroupSelectDialog.show(supportFragmentManager, it.group) + } } }