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 {
|
override fun onDown(e: MotionEvent): Boolean {
|
||||||
locked = false
|
locked = false
|
||||||
controller ?: return false
|
controller ?: return false
|
||||||
val startingOnLibraryView = listOf<View?>(
|
val startingOnLibraryView = listOf(
|
||||||
controller.activityBinding?.bottomNav,
|
controller.activityBinding?.bottomNav,
|
||||||
controller.binding.filterBottomSheet.root,
|
controller.binding.filterBottomSheet.root,
|
||||||
controller.binding.categoryHopperFrame,
|
controller.binding.categoryHopperFrame,
|
||||||
controller.activityBinding?.appBar,
|
controller.activityBinding?.appBar,
|
||||||
|
controller.visibleHeaderHolder()?.itemView,
|
||||||
).none {
|
).none {
|
||||||
it ?: return false
|
it ?: return false
|
||||||
val viewRect = Rect()
|
val viewRect = Rect()
|
||||||
|
|
|
@ -870,6 +870,12 @@ class LibraryController(
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun visibleHeaderHolder(): LibraryHeaderHolder? {
|
||||||
|
return adapter.getHeaderPositions().firstOrNull()?.let {
|
||||||
|
binding.libraryGridRecycler.recycler.findViewHolderForAdapterPosition(it) as? LibraryHeaderHolder
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private fun getHeader(firstCompletelyVisible: Boolean = false): LibraryHeaderItem? {
|
private fun getHeader(firstCompletelyVisible: Boolean = false): LibraryHeaderItem? {
|
||||||
val position = if (firstCompletelyVisible) {
|
val position = if (firstCompletelyVisible) {
|
||||||
binding.libraryGridRecycler.recycler.findFirstCompletelyVisibleItemPosition()
|
binding.libraryGridRecycler.recycler.findFirstCompletelyVisibleItemPosition()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue