Add bottom inset to bookmarks screen

This commit is contained in:
Zakhar Timoshenko
2022-08-05 20:31:08 +03:00
parent 39169d3afe
commit 0af1eebd62
2 changed files with 14 additions and 8 deletions

View File

@@ -17,6 +17,7 @@ import org.koitharu.kotatsu.base.ui.list.OnListItemClickListener
import org.koitharu.kotatsu.base.ui.list.SectionedSelectionController
import org.koitharu.kotatsu.base.ui.list.decor.AbstractSelectionItemDecoration
import org.koitharu.kotatsu.base.ui.list.decor.SpacingItemDecoration
import org.koitharu.kotatsu.base.ui.list.fastscroll.FastScroller
import org.koitharu.kotatsu.base.ui.util.ReversibleAction
import org.koitharu.kotatsu.bookmarks.data.ids
import org.koitharu.kotatsu.bookmarks.domain.Bookmark
@@ -26,6 +27,7 @@ import org.koitharu.kotatsu.databinding.FragmentListSimpleBinding
import org.koitharu.kotatsu.details.ui.DetailsActivity
import org.koitharu.kotatsu.list.ui.adapter.ListStateHolderListener
import org.koitharu.kotatsu.list.ui.model.ListModel
import org.koitharu.kotatsu.main.ui.AppBarOwner
import org.koitharu.kotatsu.parsers.model.Manga
import org.koitharu.kotatsu.reader.ui.ReaderActivity
import org.koitharu.kotatsu.utils.ext.getDisplayMessage
@@ -37,7 +39,8 @@ class BookmarksFragment :
BaseFragment<FragmentListSimpleBinding>(),
ListStateHolderListener,
OnListItemClickListener<Bookmark>,
SectionedSelectionController.Callback<Manga> {
SectionedSelectionController.Callback<Manga>,
FastScroller.FastScrollListener {
@Inject
lateinit var coil: ImageLoader
@@ -96,6 +99,12 @@ class BookmarksFragment :
override fun onEmptyActionClick() = Unit
override fun onFastScrollStart(fastScroller: FastScroller) {
(activity as? AppBarOwner)?.appBar?.setExpanded(false, true)
}
override fun onFastScrollStop(fastScroller: FastScroller) = Unit
override fun onSelectionChanged(controller: SectionedSelectionController<Manga>, count: Int) {
binding.recyclerView.invalidateNestedItemDecorations()
}