diff --git a/packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt b/packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt index 1c57487a73..bea32a9b40 100644 --- a/packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt +++ b/packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/RotationGestureHandler.kt @@ -35,7 +35,11 @@ class RotationGestureHandler : GestureHandler() { override fun onRotationBegin(detector: RotationGestureDetector) = true override fun onRotationEnd(detector: RotationGestureDetector) { - end() + if (state == STATE_ACTIVE) { + end() + } else { + fail() + } } } @@ -64,12 +68,11 @@ class RotationGestureHandler : GestureHandler() { anchorX = point.x anchorY = point.y } - if (sourceEvent.actionMasked == MotionEvent.ACTION_UP) { - if (state == STATE_ACTIVE) { - end() - } else { - fail() - } + + // ACTION_UP is already handled in rotationGestureDetector.onTouchEvent (and effectively in onRotationEnd) + // if more than one pointer was used + if (sourceEvent.actionMasked == MotionEvent.ACTION_UP && state == STATE_BEGAN) { + fail() } }