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 218bc004a..79f1a24a1 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 @@ -193,7 +193,11 @@ class BookshelfFragment : VMBaseFragment(R.layout.fragment_b }.show().applyTint() } - override fun onTabReselected(tab: TabLayout.Tab) = Unit + override fun onTabReselected(tab: TabLayout.Tab) { + fragmentMap[selectedGroup?.groupId]?.let { + toast("${selectedGroup?.groupName}(${it.getBooksCount()})") + } + } override fun onTabUnselected(tab: TabLayout.Tab) = Unit 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 a52856d33..89ba1fd0f 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 @@ -135,6 +135,10 @@ class BooksFragment : BaseFragment(R.layout.fragment_books), } } + fun getBooksCount(): Int { + return booksAdapter.getActualItemCount() + } + override fun open(book: Book) { when (book.type) { BookType.audio ->