File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
android/src/main/java/com/swmansion/gesturehandler/core Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,15 @@ class GestureHandlerOrchestrator(
8585 private fun hasOtherHandlerToWaitFor (handler : GestureHandler <* >) =
8686 gestureHandlers.any { ! isFinished(it.state) && shouldHandlerWaitForOther(handler, it) }
8787
88- private fun shouldBeCancelledByFinishedHandler (handler : GestureHandler <* >) = gestureHandlers.any { shouldHandlerWaitForOther(handler, it) && it.state == GestureHandler .STATE_END }
88+ private fun shouldBeCancelledByFinishedHandler (handler : GestureHandler <* >) =
89+ gestureHandlers.any { shouldHandlerWaitForOther(handler, it) && it.state == GestureHandler .STATE_END }
90+
91+ private fun shouldBeCancelledByActiveHandler (handler : GestureHandler <* >) =
92+ gestureHandlers.any { handler.hasCommonPointers(it) && it.state == GestureHandler .STATE_ACTIVE && ! canRunSimultaneously(handler, it) }
8993
9094 private fun tryActivate (handler : GestureHandler <* >) {
9195 // If we are waiting for a gesture that has successfully finished, we should cancel handler
92- if (shouldBeCancelledByFinishedHandler(handler)) {
96+ if (shouldBeCancelledByFinishedHandler(handler) || shouldBeCancelledByActiveHandler(handler) ) {
9397 handler.cancel()
9498 return
9599 }
You can’t perform that action at this time.
0 commit comments