mirror of
https://github.com/null2264/yokai.git
synced 2025-06-21 10:44:42 +00:00
include category headers in excluded list of library gestures
This commit is contained in:
parent
a3508a59c1
commit
2a7526e952
2 changed files with 8 additions and 1 deletions
|
@ -19,11 +19,12 @@ class LibraryCategoryGestureDetector(private val controller: LibraryController?)
|
|||
override fun onDown(e: MotionEvent): Boolean {
|
||||
locked = false
|
||||
controller ?: return false
|
||||
val startingOnLibraryView = listOf<View?>(
|
||||
val startingOnLibraryView = listOf(
|
||||
controller.activityBinding?.bottomNav,
|
||||
controller.binding.filterBottomSheet.root,
|
||||
controller.binding.categoryHopperFrame,
|
||||
controller.activityBinding?.appBar,
|
||||
controller.visibleHeaderHolder()?.itemView,
|
||||
).none {
|
||||
it ?: return false
|
||||
val viewRect = Rect()
|
||||
|
|
|
@ -870,6 +870,12 @@ class LibraryController(
|
|||
return false
|
||||
}
|
||||
|
||||
fun visibleHeaderHolder(): LibraryHeaderHolder? {
|
||||
return adapter.getHeaderPositions().firstOrNull()?.let {
|
||||
binding.libraryGridRecycler.recycler.findViewHolderForAdapterPosition(it) as? LibraryHeaderHolder
|
||||
}
|
||||
}
|
||||
|
||||
private fun getHeader(firstCompletelyVisible: Boolean = false): LibraryHeaderItem? {
|
||||
val position = if (firstCompletelyVisible) {
|
||||
binding.libraryGridRecycler.recycler.findFirstCompletelyVisibleItemPosition()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue