From d5e4d0419f97729836f800ec51a977e04b63f1fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bert?= Date: Mon, 31 Jul 2023 10:48:49 +0200 Subject: [PATCH] Mark handler as not in bounds after manual activation --- .../core/GestureHandlerOrchestrator.kt | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt b/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt index 8540669af4..419b4b4366 100644 --- a/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt +++ b/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt @@ -582,17 +582,16 @@ class GestureHandlerOrchestrator( fun activateNativeHandlersForView(view: View) { handlerRegistry.getHandlersForView(view)?.forEach { - if (it is NativeViewGestureHandler) { - this.recordHandlerIfNotPresent(it, view) - val wasInBounds = it.isWithinBounds - - it.markAsInBounds(true) - it.begin() - it.activate() - it.end() - - it.markAsInBounds(wasInBounds) + if (it !is NativeViewGestureHandler) { + return@forEach } + this.recordHandlerIfNotPresent(it, view) + + it.markAsInBounds(true) + it.begin() + it.activate() + it.end() + it.markAsInBounds(false) } }