pull/94/head
kunfei 5 years ago
parent f73852db6c
commit 727da9ae46
  1. 2
      app/src/main/java/io/legado/app/ui/book/arrange/ArrangeBookActivity.kt
  2. 8
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt

@ -37,6 +37,8 @@ class ArrangeBookActivity : VMBaseActivity<ArrangeBookViewModel>(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()

@ -66,7 +66,10 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(R.layout.fragment_b
.show(childFragmentManager, "groupManageDialog")
R.id.menu_add_local -> startActivity<ImportBookActivity>()
R.id.menu_add_url -> addBookByUrl()
R.id.menu_arrange_bookshelf -> startActivity<ArrangeBookActivity>()
R.id.menu_arrange_bookshelf -> startActivity<ArrangeBookActivity>(
Pair("groupId", selectedGroup.groupId),
Pair("groupName", selectedGroup.groupName)
)
R.id.menu_download -> startActivity<DownloadActivity>()
}
}
@ -78,6 +81,9 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(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

Loading…
Cancel
Save