Commit 8c41b09
authored
Improve multi-pointer behavior (with ScrollView) on Android (#2551)
## Description
This PR solves two problems:
- `ScrollView` wrapped with `NativeViewGestureHandler` wasn't canceling
the root view handler, which in turn meant that [`shouldIntercept` flag
was never
set](https://github.com/software-mansion/react-native-gesture-handler/blob/355a82fd3cf39b1bd4a57af958f040b563a1823e/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootHelper.kt#L71)
and event was [dispatched to both, the handler and the
view](https://github.com/software-mansion/react-native-gesture-handler/blob/355a82fd3cf39b1bd4a57af958f040b563a1823e/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerRootView.kt#L35-L37).
- After a handler was activated and the root handler was canceled
(setting `shouldIntercept` to true), and a new pointer was added to the
screen, the root handler would begin and set `shouldIntercept` back to
false. Again, this meant dispatching events both to the handler and the
view.
Fixes
#1679
## Test plan
Tested on the Example app and [reproduction from the
issue](#1679 (comment))1 parent 95854bf commit 8c41b09
File tree
3 files changed
+11
-1
lines changed- android/src/main/java/com/swmansion/gesturehandler
- core
- react
3 files changed
+11
-1
lines changedLines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
325 | 325 | | |
326 | 326 | | |
327 | 327 | | |
| 328 | + | |
| 329 | + | |
328 | 330 | | |
329 | 331 | | |
330 | 332 | | |
| |||
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| 79 | + | |
78 | 80 | | |
79 | 81 | | |
80 | 82 | | |
| |||
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
251 | 257 | | |
Lines changed: 3 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
63 | 65 | | |
64 | 66 | | |
65 | 67 | | |
| |||
0 commit comments