File tree 1 file changed +6
-2
lines changed
android/src/main/java/com/swmansion/gesturehandler/core
1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -85,11 +85,15 @@ class GestureHandlerOrchestrator(
85
85
private fun hasOtherHandlerToWaitFor (handler : GestureHandler <* >) =
86
86
gestureHandlers.any { ! isFinished(it.state) && shouldHandlerWaitForOther(handler, it) }
87
87
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) }
89
93
90
94
private fun tryActivate (handler : GestureHandler <* >) {
91
95
// 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) ) {
93
97
handler.cancel()
94
98
return
95
99
}
You can’t perform that action at this time.
0 commit comments