Skip to content

fix: android - Pinch gesture handler when one finger is lifted#1800

Closed
intergalacticspacehighway wants to merge 5 commits intosoftware-mansion:mainfrom
intergalacticspacehighway:fix/android-single-pointer-pinch-approach#2
Closed

fix: android - Pinch gesture handler when one finger is lifted#1800
intergalacticspacehighway wants to merge 5 commits intosoftware-mansion:mainfrom
intergalacticspacehighway:fix/android-single-pointer-pinch-approach#2

Conversation

@intergalacticspacehighway
Copy link
Copy Markdown

Description

I agree with the notion of preserving the platform behaviour on iOS but in case of android there's no native pinch handler and some custom logic is already there in place, so I am not sure what behavior is correct.

Approach

  • End the gesture on ACTION_UP. i.e. both fingers are lifted.
  • Added a property in PinchGestureHandler to control the numberOfPointer during ACTION_POINTER_UP

Test plan

  • We can test it with the below snippet. Pinch handler will only move to end state when both the fingers are lifted.
  • This gist can also be tested. With the changes in this PR, the gist code will run same in both the platforms.
const handler = useAnimatedGestureHandler<PinchGestureHandlerGestureEvent>({
    onActive(e) {
      console.log("Active")
    },
    onEnd(e) {
      console.log("Ended")
    }
});


// Attach the handler to PinchGestureHandler
<PinchGestureHandler onGestureEvent={handler}>
      <Animated.View
        style={{ height: 300, width: 300, backgroundColor: "pink" }}
      />
</PinchGestureHandler>

@wcandillon
Copy link
Copy Markdown

I can confirm that Android behaves differently from iOS there

@m-bert
Copy link
Copy Markdown
Collaborator

m-bert commented Apr 14, 2026

This seems to work in both V2 and V3 API. Let me know if this should be reopened.

@m-bert m-bert closed this Apr 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants