pull/78/head
kunfei 5 years ago
parent b7023fd4f8
commit 0183a9f437
  1. 2
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt
  2. 5
      app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt

@ -15,7 +15,7 @@ class BookshelfAdapter(fragment: Fragment, val callBack: CallBack) :
override fun createFragment(position: Int): Fragment {
val groupId = callBack.getGroup(position).groupId
return BooksFragment.newInstance(groupId)
return BooksFragment.newInstance(position, groupId)
}
interface CallBack {

@ -32,10 +32,11 @@ class BooksFragment : BaseFragment(R.layout.fragment_books),
BooksAdapter.CallBack {
companion object {
fun newInstance(position: Int): BooksFragment {
fun newInstance(position: Int, groupId: Int): BooksFragment {
return BooksFragment().apply {
val bundle = Bundle()
bundle.putInt("groupId", position)
bundle.putInt("position", position)
bundle.putInt("groupId", groupId)
arguments = bundle
}
}

Loading…
Cancel
Save