Commit 23c6413
authored
[Android] Check all pointers in move events (#4010)
## Description
When one pointer is placed on the background, handlers don't to other
pointers. Instead, they fail on [this
line](https://github.com/software-mansion/react-native-gesture-handler/blob/41fbd374a85def52eb7051f96e3d4c63e6eb0724/packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt#L295).
This is because on Android events with `ACTION_MOVE` are batched and all
pointers are contained within one event. As [Android docs
say](https://developer.android.com/reference/android/view/MotionEvent#getActionIndex()),
`actionIndex` is fine to check for up and down actions. However, we use
it for move action and it always returns `0`.
To solve this problem, I've added loop that checks whether any pointer
from event is tracked by the handler.
Fixes #3995
## Test plan
Tested on example code from #39951 parent 5429e5e commit 23c6413
1 file changed
Lines changed: 16 additions & 5 deletions
File tree
- packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core
Lines changed: 16 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
644 | 644 | | |
645 | 645 | | |
646 | 646 | | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | | - | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
652 | 663 | | |
653 | 664 | | |
654 | 665 | | |
| |||
0 commit comments