点击分组提示分组书籍数量

pull/457/head
gedoor 4 years ago
parent 2b21a0f501
commit 4702199ce4
  1. 6
      app/src/main/java/io/legado/app/ui/main/bookshelf/BookshelfFragment.kt
  2. 4
      app/src/main/java/io/legado/app/ui/main/bookshelf/books/BooksFragment.kt

@ -193,7 +193,11 @@ class BookshelfFragment : VMBaseFragment<BookshelfViewModel>(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

@ -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 ->

Loading…
Cancel
Save