Skip to content

Commit 14198ad

Browse files
j-piaseckifacebook-github-bot
authored andcommitted
Allow to disable shouldDelayChildPressedState on scrollable Android containers
Summary: 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 0a5bf33 commit 14198ad

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
@@ -3303,6 +3303,11 @@ public abstract class com/facebook/react/uimanager/GuardedFrameCallback : androi
33033303
protected abstract fun doFrameGuarded (J)V
33043304
}
33053305

3306+
public abstract interface class com/facebook/react/uimanager/HasChildPressedStateDelay {
3307+
public abstract fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
3308+
public abstract fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
3309+
}
3310+
33063311
public abstract interface class com/facebook/react/uimanager/IViewGroupManager : com/facebook/react/uimanager/IViewManagerWithChildren {
33073312
public abstract fun addView (Landroid/view/View;Landroid/view/View;I)V
33083313
public abstract fun getChildAt (Landroid/view/View;I)Landroid/view/View;
@@ -5146,10 +5151,13 @@ public abstract interface class com/facebook/react/viewmanagers/VirtualViewManag
51465151
public abstract fun setRenderState (Landroid/view/View;I)V
51475152
}
51485153

5149-
public final class com/facebook/react/views/drawer/ReactDrawerLayout : androidx/drawerlayout/widget/DrawerLayout {
5154+
public final class com/facebook/react/views/drawer/ReactDrawerLayout : androidx/drawerlayout/widget/DrawerLayout, com/facebook/react/uimanager/HasChildPressedStateDelay {
51505155
public fun <init> (Lcom/facebook/react/bridge/ReactContext;)V
5156+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
51515157
public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z
51525158
public fun onTouchEvent (Landroid/view/MotionEvent;)Z
5159+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
5160+
public fun shouldDelayChildPressedState ()Z
51535161
}
51545162

51555163
public final class com/facebook/react/views/drawer/ReactDrawerLayoutManager : com/facebook/react/uimanager/ViewGroupManager, com/facebook/react/viewmanagers/AndroidDrawerLayoutManagerInterface {
@@ -5450,7 +5458,7 @@ public final class com/facebook/react/views/scroll/ReactHorizontalScrollContaine
54505458
public final class com/facebook/react/views/scroll/ReactHorizontalScrollContainerViewManager$Companion {
54515459
}
54525460

5453-
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 {
5461+
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 {
54545462
public fun <init> (Landroid/content/Context;)V
54555463
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
54565464
public synthetic fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -5470,6 +5478,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
54705478
public fun getFadingEdgeLengthStart ()I
54715479
public fun getFlingAnimator ()Landroid/animation/ValueAnimator;
54725480
public fun getFlingExtrapolatedDistance (I)I
5481+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
54735482
public fun getLastScrollDispatchTime ()J
54745483
protected fun getLeftFadingEdgeStrength ()F
54755484
public fun getOverflow ()Ljava/lang/String;
@@ -5517,6 +5526,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
55175526
public fun setEndFillColor (I)V
55185527
public fun setFadingEdgeLengthEnd (I)V
55195528
public fun setFadingEdgeLengthStart (I)V
5529+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
55205530
public fun setLastScrollDispatchTime (J)V
55215531
public fun setOverflow (Ljava/lang/String;)V
55225532
public fun setOverflowInset (IIII)V
@@ -5535,6 +5545,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollView : android
55355545
public fun setSnapToEnd (Z)V
55365546
public fun setSnapToStart (Z)V
55375547
public fun setStateWrapper (Lcom/facebook/react/uimanager/StateWrapper;)V
5548+
public fun shouldDelayChildPressedState ()Z
55385549
public fun startFlingAnimator (II)V
55395550
public fun updateClippingRect ()V
55405551
public fun updateClippingRect (Ljava/util/Set;)V
@@ -5597,7 +5608,7 @@ public class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager :
55975608
public final class com/facebook/react/views/scroll/ReactHorizontalScrollViewManager$Companion {
55985609
}
55995610

5600-
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 {
5611+
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 {
56015612
public fun <init> (Landroid/content/Context;)V
56025613
public fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;)V
56035614
public synthetic fun <init> (Landroid/content/Context;Lcom/facebook/react/views/scroll/FpsListener;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
@@ -5615,6 +5626,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56155626
public fun getFadingEdgeLengthStart ()I
56165627
public fun getFlingAnimator ()Landroid/animation/ValueAnimator;
56175628
public fun getFlingExtrapolatedDistance (I)I
5629+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
56185630
public fun getLastScrollDispatchTime ()J
56195631
protected fun getOverScrollerFromParent ()Landroid/widget/OverScroller;
56205632
public fun getOverflow ()Ljava/lang/String;
@@ -5661,6 +5673,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56615673
public fun setEndFillColor (I)V
56625674
public fun setFadingEdgeLengthEnd (I)V
56635675
public fun setFadingEdgeLengthStart (I)V
5676+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
56645677
public fun setLastScrollDispatchTime (J)V
56655678
public fun setOverflow (Ljava/lang/String;)V
56665679
public fun setOverflowInset (IIII)V
@@ -5681,6 +5694,7 @@ public class com/facebook/react/views/scroll/ReactScrollView : android/widget/Sc
56815694
public fun setSnapToEnd (Z)V
56825695
public fun setSnapToStart (Z)V
56835696
public fun setStateWrapper (Lcom/facebook/react/uimanager/StateWrapper;)V
5697+
public fun shouldDelayChildPressedState ()Z
56845698
public fun startFlingAnimator (II)V
56855699
public fun updateClippingRect ()V
56865700
public fun updateClippingRect (Ljava/util/Set;)V
@@ -5949,15 +5963,18 @@ public final class com/facebook/react/views/scroll/VirtualViewContainerState$Com
59495963
public final fun create (Landroid/view/ViewGroup;)Lcom/facebook/react/views/scroll/VirtualViewContainerState;
59505964
}
59515965

5952-
public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout {
5966+
public class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout, com/facebook/react/uimanager/HasChildPressedStateDelay {
59535967
public fun <init> (Lcom/facebook/react/bridge/ReactContext;)V
59545968
public fun canChildScrollUp ()Z
5969+
public fun getHasChildPressedStateDelay ()Ljava/lang/Boolean;
59555970
public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z
59565971
public fun onLayout (ZIIII)V
59575972
public fun onTouchEvent (Landroid/view/MotionEvent;)Z
59585973
public fun requestDisallowInterceptTouchEvent (Z)V
5974+
public fun setHasChildPressedStateDelay (Ljava/lang/Boolean;)V
59595975
public final fun setProgressViewOffset (F)V
59605976
public fun setRefreshing (Z)V
5977+
public fun shouldDelayChildPressedState ()Z
59615978
}
59625979

59635980
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)