Skip to content

Commit d0e7a59

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Allow to disable shouldDelayChildPressedState on scrollable Android containers (#57259)
Summary: X-link: #57128 Changelog: [Android][Added] Added an entry point that allows changing whether the scrollable React Native containers should delay pressed state in children views Scrollable Android containers should return `true` (the default implementation) from [`shouldDelayChildPressedState`](https://developer.android.com/reference/android/view/ViewGroup#shouldDelayChildPressedState%28%29) in order to delay pressed state feedback in children. This way the feedback isn't triggered at all during quick scrolls. React Native touch system doesn't rely on this so it's not affected by that behavior, but native components are which can produce a divergent experience. This diff adds a property to all scrollable components of React Native which allows external consumers to control this behavor on a per-view basis. The API is analoguous to [`delaysContentTouches`](https://developer.apple.com/documentation/uikit/uiscrollview/delayscontenttouches?language=objc) on iOS. Differential Revision: D108003375
1 parent 803456d commit d0e7a59

7 files changed

Lines changed: 87 additions & 10 deletions

File tree

packages/react-native/ReactAndroid/api/ReactAndroid.api

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3313,6 +3313,11 @@ public abstract class com/facebook/react/uimanager/GuardedFrameCallback : androi
33133313
protected abstract fun doFrameGuarded (J)V
33143314
}
33153315

3316+
public abstract interface class com/facebook/react/uimanager/HasChildPressedStateDelay {
3317+
public abstract fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
3318+
public abstract fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
3319+
}
3320+
33163321
public abstract interface class com/facebook/react/uimanager/IViewGroupManager : com/facebook/react/uimanager/IViewManagerWithChildren {
33173322
public abstract fun addView (Landroid/view/View;Landroid/view/View;I)V
33183323
public abstract fun getChildAt (Landroid/view/View;I)Landroid/view/View;
@@ -5156,10 +5161,13 @@ public abstract interface class com/facebook/react/viewmanagers/VirtualViewManag
51565161
public abstract fun setRenderState (Landroid/view/View;I)V
51575162
}
51585163

5159-
public final class com/facebook/react/views/drawer/ReactDrawerLayout : androidx/drawerlayout/widget/DrawerLayout {
5164+
public final class com/facebook/react/views/drawer/ReactDrawerLayout : androidx/drawerlayout/widget/DrawerLayout, com/facebook/react/uimanager/HasChildPressedStateDelay {
51605165
public fun <init> (Lcom/facebook/react/bridge/ReactContext;)V
5166+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
51615167
public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z
51625168
public fun onTouchEvent (Landroid/view/MotionEvent;)Z
5169+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
5170+
public fun shouldDelayChildPressedState ()Z
51635171
}
51645172

51655173
public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerInterface {
@@ -5460,7 +5468,7 @@ public final class com/facebook/react/views/scroll/ReactHorizontalScrollContaine
54605468
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion {
54615469
}
54625470

5463-
public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android/widget/HorizontalScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactAccessibleScrollView, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper, com/facebook/react/views/scroll/VirtualViewContainer {
5471+
public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android/widget/HorizontalScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/HasChildPressedStateDelay, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactAccessibleScrollView, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper, com/facebook/react/views/scroll/VirtualViewContainer {
54645472
public fun <init> (Landroid/content/Context;)V
54655473
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
54665474
public synthetic fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -5480,6 +5488,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
54805488
public fun getFadingEdgeLengthStart ()I
54815489
public fun getFlingAnimator ()Landroid/animation/ValueAnimator;
54825490
public fun getFlingExtrapolatedDistance (I)I
5491+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
54835492
public fun getLastScrollDispatchTime ()J
54845493
protected fun getLeftFadingEdgeStrength ()F
54855494
public fun getOverflow ()Ljava/lang/String;
@@ -5527,6 +5536,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
55275536
public fun setEndFillColor (I)V
55285537
public fun setFadingEdgeLengthEnd (I)V
55295538
public fun setFadingEdgeLengthStart (I)V
5539+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
55305540
public fun setLastScrollDispatchTime (J)V
55315541
public fun setOverflow (Ljava/lang/String;)V
55325542
public fun setOverflowInset (IIII)V
@@ -5545,6 +5555,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
55455555
public fun setSnapToEnd (Z)V
55465556
public fun setSnapToStart (Z)V
55475557
public fun setStateWrapper (Lcom/facebook/react/uimanager/StateWrapper;)V
5558+
public fun shouldDelayChildPressedState ()Z
55485559
public fun startFlingAnimator (II)V
55495560
public fun updateClippingRect ()V
55505561
public fun updateClippingRect (Ljava/util/Set;)V
@@ -5607,7 +5618,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager :
56075618
public final class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager$Companion {
56085619
}
56095620

5610-
public class com/facebook/react/views/scroll/ReactScrollView : android/widget/ScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactAccessibleScrollView, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper, com/facebook/react/views/scroll/VirtualViewContainer {
5621+
public class com/facebook/react/views/scroll/ReactScrollView : android/widget/ScrollView, android/view/View$OnLayoutChangeListener, android/view/ViewGroup$OnHierarchyChangeListener, com/facebook/react/uimanager/HasChildPressedStateDelay, com/facebook/react/uimanager/ReactClippingViewGroup, com/facebook/react/uimanager/ReactOverflowViewWithInset, com/facebook/react/views/scroll/ReactAccessibleScrollView, com/facebook/react/views/scroll/ReactScrollViewHelper$HasFlingAnimator, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollEventThrottle, com/facebook/react/views/scroll/ReactScrollViewHelper$HasScrollState, com/facebook/react/views/scroll/ReactScrollViewHelper$HasSmoothScroll, com/facebook/react/views/scroll/ReactScrollViewHelper$HasStateWrapper, com/facebook/react/views/scroll/VirtualViewContainer {
56115622
public fun <init> (Landroid/content/Context;)V
56125623
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
56135624
public synthetic fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -5625,6 +5636,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56255636
public fun getFadingEdgeLengthStart ()I
56265637
public fun getFlingAnimator ()Landroid/animation/ValueAnimator;
56275638
public fun getFlingExtrapolatedDistance (I)I
5639+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
56285640
public fun getLastScrollDispatchTime ()J
56295641
protected fun getOverScrollerFromParent ()Landroid/widget/OverScroller;
56305642
public fun getOverflow ()Ljava/lang/String;
@@ -5671,6 +5683,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56715683
public fun setEndFillColor (I)V
56725684
public fun setFadingEdgeLengthEnd (I)V
56735685
public fun setFadingEdgeLengthStart (I)V
5686+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
56745687
public fun setLastScrollDispatchTime (J)V
56755688
public fun setOverflow (Ljava/lang/String;)V
56765689
public fun setOverflowInset (IIII)V
@@ -5691,6 +5704,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56915704
public fun setSnapToEnd (Z)V
56925705
public fun setSnapToStart (Z)V
56935706
public fun setStateWrapper (Lcom/facebook/react/uimanager/StateWrapper;)V
5707+
public fun shouldDelayChildPressedState ()Z
56945708
public fun startFlingAnimator (II)V
56955709
public fun updateClippingRect ()V
56965710
public fun updateClippingRect (Ljava/util/Set;)V
@@ -5959,15 +5973,18 @@ public final class com/facebook/react/views/scroll/VirtualViewContainerState$Com
59595973
public final fun create (Landroid/view/ViewGroup;)Lcom/facebook/react/views/scroll/VirtualViewContainerState;
59605974
}
59615975

5962-
public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout {
5976+
public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout, com/facebook/react/uimanager/HasChildPressedStateDelay {
59635977
public fun <init> (Lcom/facebook/react/bridge/ReactContext;)V
59645978
public fun canChildScrollUp ()Z
5979+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
59655980
public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z
59665981
public fun onLayout (ZIIII)V
59675982
public fun onTouchEvent (Landroid/view/MotionEvent;)Z
59685983
public fun requestDisallowInterceptTouchEvent (Z)V
5984+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
59695985
public final fun setProgressViewOffset (F)V
59705986
public fun setRefreshing (Z)V
5987+
public fun shouldDelayChildPressedState ()Z
59715988
}
59725989

59735990
public final class com/facebook/react/views/text/DefaultStyleValuesUtil {
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
package com.facebook.react.uimanager
9+
10+
/**
11+
* Implemented by scrollable container views that allow the delaying of their children's pressed
12+
* state (see [android.view.ViewGroup.shouldDelayChildPressedState]) to be toggled externally,
13+
* without changing the view's default behavior.
14+
*
15+
* This lets a module that holds a reference to such a container disable the delay (e.g. when it
16+
* knows the gesture will not turn into a scroll, so children should show their pressed state
17+
* immediately) and re-enable it afterwards.
18+
*/
19+
public interface HasChildPressedStateDelay {
20+
/**
21+
* Overrides whether this view delays its children's pressed state (see
22+
* [android.view.ViewGroup.shouldDelayChildPressedState]).
23+
*
24+
* When `null` (the default), the view's framework default is used. Set to `true` or `false` to
25+
* force the behavior, and back to `null` to restore the default. Lets a module holding a
26+
* reference to the container toggle the delay without changing the default.
27+
*/
28+
public var hasChildPressedStateDelay: Boolean?
29+
}

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/drawer/ReactDrawerLayout.kt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import com.facebook.common.logging.FLog
2020
import com.facebook.react.R
2121
import com.facebook.react.bridge.ReactContext
2222
import com.facebook.react.common.ReactConstants
23+
import com.facebook.react.uimanager.HasChildPressedStateDelay
2324
import com.facebook.react.uimanager.ReactAccessibilityDelegate.AccessibilityRole
2425
import com.facebook.react.uimanager.events.NativeGestureUtil.notifyNativeGestureEnded
2526
import com.facebook.react.uimanager.events.NativeGestureUtil.notifyNativeGestureStarted
@@ -28,11 +29,14 @@ import com.facebook.react.uimanager.events.NativeGestureUtil.notifyNativeGesture
2829
* Wrapper view for [DrawerLayout]. It manages the properties that can be set on the drawer and
2930
* contains some ReactNative-specific functionality.
3031
*/
31-
public class ReactDrawerLayout(reactContext: ReactContext) : DrawerLayout(reactContext) {
32+
public class ReactDrawerLayout(reactContext: ReactContext) :
33+
DrawerLayout(reactContext), HasChildPressedStateDelay {
3234
private var drawerPosition = Gravity.START
3335
private var drawerWidth = DEFAULT_DRAWER_WIDTH
3436
private var dragging = false
3537

38+
override var hasChildPressedStateDelay: Boolean? = null
39+
3640
init {
3741
ViewCompat.setAccessibilityDelegate(
3842
this,
@@ -60,6 +64,9 @@ public class ReactDrawerLayout(reactContext: ReactContext) : DrawerLayout(reactC
6064
)
6165
}
6266

67+
override fun shouldDelayChildPressedState(): Boolean =
68+
hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
69+
6370
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
6471
try {
6572
if (super.onInterceptTouchEvent(ev)) {

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactHorizontalScrollView.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ import com.facebook.react.common.ReactConstants
3636
import com.facebook.react.common.build.ReactBuildConfig
3737
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
3838
import com.facebook.react.uimanager.BackgroundStyleApplicator
39+
import com.facebook.react.uimanager.HasChildPressedStateDelay
3940
import com.facebook.react.uimanager.LengthPercentage
4041
import com.facebook.react.uimanager.LengthPercentageType
4142
import com.facebook.react.uimanager.MeasureSpecAssertions
@@ -84,7 +85,8 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
8485
HasFlingAnimator,
8586
HasScrollEventThrottle,
8687
HasSmoothScroll,
87-
VirtualViewContainer {
88+
VirtualViewContainer,
89+
HasChildPressedStateDelay {
8890

8991
private companion object {
9092
private val DEBUG_MODE = false && ReactBuildConfig.DEBUG
@@ -197,6 +199,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
197199
override var stateWrapper: StateWrapper? = null
198200
override var scrollEventThrottle: Int = 0
199201
override var lastScrollDispatchTime: Long = 0L
202+
override var hasChildPressedStateDelay: Boolean? = null
200203

201204
override val virtualViewContainerState: VirtualViewContainerState
202205
get() =
@@ -631,6 +634,9 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
631634
}
632635
}
633636

637+
override fun shouldDelayChildPressedState(): Boolean =
638+
hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
639+
634640
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
635641
if (!scrollEnabled) return false
636642

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactNestedScrollView.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* This source code is licensed under the MIT license found in the
55
* LICENSE file in the root directory of this source tree.
66
*
7-
* @generated SignedSource<<2b0cbc5249ac34ae7f030a9c0fffd1f3>>
7+
* @generated SignedSource<<cf60b52e15df339a179f392723007fab>>
88
*/
99

1010
/**
@@ -38,6 +38,7 @@ import com.facebook.react.bridge.ReadableMap
3838
import com.facebook.react.common.ReactConstants
3939
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
4040
import com.facebook.react.uimanager.BackgroundStyleApplicator
41+
import com.facebook.react.uimanager.HasChildPressedStateDelay
4142
import com.facebook.react.uimanager.LengthPercentage
4243
import com.facebook.react.uimanager.LengthPercentageType
4344
import com.facebook.react.uimanager.MeasureSpecAssertions
@@ -93,7 +94,8 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
9394
HasFlingAnimator,
9495
HasScrollEventThrottle,
9596
HasSmoothScroll,
96-
VirtualViewContainer {
97+
VirtualViewContainer,
98+
HasChildPressedStateDelay {
9799

98100
private companion object {
99101
private var scrollerField: java.lang.reflect.Field? = null
@@ -107,6 +109,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
107109
override var stateWrapper: StateWrapper? = null
108110
override var scrollEventThrottle: Int = 0
109111
override var lastScrollDispatchTime: Long = 0L
112+
override var hasChildPressedStateDelay: Boolean? = null
110113

111114
public open var pointerEvents: PointerEvents = PointerEvents.AUTO
112115

@@ -552,6 +555,9 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
552555
}
553556
}
554557

558+
override fun shouldDelayChildPressedState(): Boolean =
559+
hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
560+
555561
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
556562
if (!scrollEnabled) return false
557563
if (!PointerEvents.canChildrenBeTouchTarget(pointerEvents)) return true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/scroll/ReactScrollView.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ import com.facebook.react.bridge.ReadableMap
3030
import com.facebook.react.common.ReactConstants
3131
import com.facebook.react.internal.featureflags.ReactNativeFeatureFlags
3232
import com.facebook.react.uimanager.BackgroundStyleApplicator
33+
import com.facebook.react.uimanager.HasChildPressedStateDelay
3334
import com.facebook.react.uimanager.LengthPercentage
3435
import com.facebook.react.uimanager.LengthPercentageType
3536
import com.facebook.react.uimanager.MeasureSpecAssertions
@@ -85,7 +86,8 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
8586
HasFlingAnimator,
8687
HasScrollEventThrottle,
8788
HasSmoothScroll,
88-
VirtualViewContainer {
89+
VirtualViewContainer,
90+
HasChildPressedStateDelay {
8991

9092
private companion object {
9193
private var scrollerField: java.lang.reflect.Field? = null
@@ -99,6 +101,7 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
99101
override var stateWrapper: StateWrapper? = null
100102
override var scrollEventThrottle: Int = 0
101103
override var lastScrollDispatchTime: Long = 0L
104+
override var hasChildPressedStateDelay: Boolean? = null
102105

103106
public open var pointerEvents: PointerEvents = PointerEvents.AUTO
104107

@@ -544,6 +547,9 @@ constructor(context: Context, private val fpsListener: FpsListener? = null) :
544547
}
545548
}
546549

550+
override fun shouldDelayChildPressedState(): Boolean =
551+
hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
552+
547553
override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
548554
if (!scrollEnabled) return false
549555
if (!PointerEvents.canChildrenBeTouchTarget(pointerEvents)) return true

packages/react-native/ReactAndroid/src/main/java/com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout.kt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,14 @@ import android.view.ViewConfiguration
1212
import android.view.ViewGroup
1313
import androidx.swiperefreshlayout.widget.SwipeRefreshLayout
1414
import com.facebook.react.bridge.ReactContext
15+
import com.facebook.react.uimanager.HasChildPressedStateDelay
1516
import com.facebook.react.uimanager.PixelUtil
1617
import com.facebook.react.uimanager.events.NativeGestureUtil
1718
import kotlin.math.abs
1819

1920
/** Basic extension of [SwipeRefreshLayout] with ReactNative-specific functionality. */
2021
public open class ReactSwipeRefreshLayout(reactContext: ReactContext) :
21-
SwipeRefreshLayout(reactContext) {
22+
SwipeRefreshLayout(reactContext), HasChildPressedStateDelay {
2223

2324
private var didLayout: Boolean = false
2425
private var refreshing: Boolean = false
@@ -28,6 +29,8 @@ public open class ReactSwipeRefreshLayout(reactContext: ReactContext) :
2829
private var intercepted: Boolean = false
2930
private var nativeGestureStarted: Boolean = false
3031

32+
override var hasChildPressedStateDelay: Boolean? = null
33+
3134
public override fun setRefreshing(refreshing: Boolean) {
3235
this.refreshing = refreshing
3336

@@ -79,6 +82,9 @@ public open class ReactSwipeRefreshLayout(reactContext: ReactContext) :
7982
parent?.requestDisallowInterceptTouchEvent(disallowIntercept)
8083
}
8184

85+
override fun shouldDelayChildPressedState(): Boolean =
86+
hasChildPressedStateDelay ?: super.shouldDelayChildPressedState()
87+
8288
public override fun onInterceptTouchEvent(ev: MotionEvent): Boolean {
8389
if (shouldInterceptTouchEvent(ev) && super.onInterceptTouchEvent(ev)) {
8490
NativeGestureUtil.notifyNativeGestureStarted(this, ev)

0 commit comments

Comments
 (0)