You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Android] Use asReversed instead of reversed (#3598)
## Description
Some of our users experience crashes that `reversed` is not defined:
```
java.lang.NoSuchMethodError: No virtual method reversed()Ljava/util/List;
```
This PR changes `reversed` occurrences to either `asReversed` (if possible), or `asReversed().toList()`, if array can be modified.
Closes#3594
## Test plan
Tested on expo-example (mostly _transformations_, _multitap_).
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/core/GestureHandlerOrchestrator.kt
+7-4Lines changed: 7 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -207,7 +207,7 @@ class GestureHandlerOrchestrator(
207
207
}
208
208
209
209
// Clear all awaiting handlers waiting for the current handler to fail
210
-
for (otherHandler in awaitingHandlers.reversed()) {
210
+
for (otherHandler in awaitingHandlers.asReversed()) {
211
211
if (shouldHandlerBeCancelledBy(otherHandler, handler)) {
212
212
otherHandler.isAwaiting =false
213
213
}
@@ -256,15 +256,18 @@ class GestureHandlerOrchestrator(
256
256
}
257
257
258
258
privatefuncancelAll() {
259
-
for (handler in awaitingHandlers.reversed()) {
259
+
// We need `toList` as `awaitingHandlers` can be modified by `cancel`:
0 commit comments