From 727da9ae4675657a757245513280c70f3a51e9b0 Mon Sep 17 00:00:00 2001 From: kunfei Date: Fri, 7 Feb 2020 13:55:50 +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 --- .../io/legado/app/ui/book/arrange/ArrangeBookActivity.kt | 2 ++ .../io/legado/app/ui/main/bookshelf/BookshelfFragment.kt | 8 +++++++- 2 files changed, 9 insertions(+), 1 deletion(-) 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 47e912322..783e7e6da 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 @@ -37,6 +37,8 @@ class ArrangeBookActivity : VMBaseActivity(R.layout.activi private var groupId: Int = -1 override fun onActivityCreated(savedInstanceState: Bundle?) { + groupId = intent.getIntExtra("groupId", -1) + title_bar.subtitle = intent.getStringExtra("groupName") ?: getString(R.string.all) initView() initGroupData() initBookData() diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt index c51bd46e2..8b76c7412 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt @@ -66,7 +66,10 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b .show(childFragmentManager, "groupManageDialog") R.id.menu_add_local -> startActivity() R.id.menu_add_url -> addBookByUrl() - R.id.menu_arrange_bookshelf -> startActivity() + R.id.menu_arrange_bookshelf -> startActivity( + Pair("groupId", selectedGroup.groupId), + Pair("groupName", selectedGroup.groupName) + ) R.id.menu_download -> startActivity() } } @@ -78,6 +81,9 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b return bookGroups[position] } + val selectedGroup: BookGroup + get() = bookGroups[view_pager_bookshelf.currentItem] + private fun initRecyclerView() { tab_layout.isTabIndicatorFullWidth = false tab_layout.tabMode = TabLayout.MODE_SCROLLABLE