From 0183a9f4373c05b62dd2436588dae050c312fec2 Mon Sep 17 00:00:00 2001 From: kunfei Date: Sat, 25 Jan 2020 20:15:20 +0800 Subject: [PATCH] up --- .../java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt | 2 +- .../io/legado/app/ui/main/bookshelf/books/BooksFragment.kt | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt index d3ba217a0..4caa119cd 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfAdapter.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 { diff --git a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt index 765c06697..9c0e935ab 100644 --- a/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt +++ b/app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt @@ -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 } }