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) + } } }