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
Copy file name to clipboardExpand all lines: packages/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt
+5-10Lines changed: 5 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -440,7 +440,11 @@ class RNGestureHandlerButtonViewManager :
440
440
val isResponder = tryGrabbingResponder()
441
441
if (isResponder) {
442
442
isTouched =true
443
+
// when setPressed(true) is called before canBegin it will not call super.setPressed
444
+
// in this case we call it here
445
+
setPressed(true)
443
446
}
447
+
444
448
return isResponder
445
449
}
446
450
@@ -515,16 +519,6 @@ class RNGestureHandlerButtonViewManager :
515
519
}
516
520
517
521
overridefunsetPressed(pressed:Boolean) {
518
-
// there is a possibility of this method being called before NativeViewGestureHandler has
519
-
// opportunity to call canStart, in that case we need to grab responder in case the gesture
520
-
// will activate
521
-
// when canStart is called eventually, tryGrabbingResponder will return true if the button
522
-
// already is a responder
523
-
if (pressed) {
524
-
if (tryGrabbingResponder()) {
525
-
soundResponder =this
526
-
}
527
-
}
528
522
// button can be pressed alongside other button if both are non-exclusive and it doesn't have
529
523
// any pressed children (to prevent pressing the parent when children is pressed).
530
524
val canBePressedAlongsideOther =!exclusive && touchResponder?.exclusive !=true&&!isChildTouched()
@@ -535,6 +529,7 @@ class RNGestureHandlerButtonViewManager :
535
529
isTouched = pressed
536
530
super.setPressed(pressed)
537
531
}
532
+
538
533
if (!pressed && touchResponder ===this) {
539
534
// if the responder is no longer pressed we release button responder
0 commit comments