Skip to content

Commit 03b1bf6

Browse files
Abbondanzometa-codesync[bot]
authored andcommitted
Back out "Forward ACTION_SCROLL events to SwipeRefreshLayout children" (#55194)
Summary: Pull Request resolved: #55194 Reverts #55097 Original Phabricator Diff: D90209679 Reverting this behavior and feature flag as the experiment that used it is no longer needed Changelog: [Internal] Reviewed By: cortinico Differential Revision: D90791564 fbshipit-source-id: 362399c435a0c5addba5734e333bc2c1747f7293
1 parent 1c63877 commit 03b1bf6

22 files changed

Lines changed: 39 additions & 189 deletions

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6025,7 +6025,6 @@ public abstract interface class com/facebook/react/views/scroll/VirtualView {
60256025
public final class com/facebook/react/views/swiperefresh/ReactSwipeRefreshLayout : androidx/swiperefreshlayout/widget/SwipeRefreshLayout {
60266026
public fun <init> (Lcom/facebook/react/bridge/ReactContext;)V
60276027
public fun canChildScrollUp ()Z
6028-
public fun dispatchGenericMotionEvent (Landroid/view/MotionEvent;)Z
60296028
public fun onInterceptTouchEvent (Landroid/view/MotionEvent;)Z
60306029
public fun onLayout (ZIIII)V
60316030
public fun onTouchEvent (Landroid/view/MotionEvent;)Z

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlags.kt‎

Lines changed: 1 addition & 7 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<<2329e4100b9b70dce294c618d0616e98>>
7+
* @generated SignedSource<<27dfa9832869aa05987fa7cb9740f7ba>>
88
*/
99

1010
/**
@@ -384,12 +384,6 @@ public object ReactNativeFeatureFlags {
384384
@JvmStatic
385385
public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = accessor.overrideBySynchronousMountPropsAtMountingAndroid()
386386

387-
/**
388-
* When enabled, ReactSwipeRefreshLayout will forward ACTION_SCROLL events to its child for proper handling.
389-
*/
390-
@JvmStatic
391-
public fun passScrollToSwipeRefreshChild(): Boolean = accessor.passScrollToSwipeRefreshChild()
392-
393387
/**
394388
* Enable reporting Performance Issues (`detail.devtools.performanceIssue`). Displayed in the V2 Performance Monitor and the "Performance Issues" sub-panel in DevTools.
395389
*/

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxAccessor.kt‎

Lines changed: 1 addition & 11 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<<ddaac394d5d58b2dd3416f5155d4df03>>
7+
* @generated SignedSource<<6fb19235ba5049e07952cfa1b564e9e2>>
88
*/
99

1010
/**
@@ -79,7 +79,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
7979
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
8080
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
8181
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
82-
private var passScrollToSwipeRefreshChildCache: Boolean? = null
8382
private var perfIssuesEnabledCache: Boolean? = null
8483
private var perfMonitorV2EnabledCache: Boolean? = null
8584
private var preparedTextCacheSizeCache: Double? = null
@@ -630,15 +629,6 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
630629
return cached
631630
}
632631

633-
override fun passScrollToSwipeRefreshChild(): Boolean {
634-
var cached = passScrollToSwipeRefreshChildCache
635-
if (cached == null) {
636-
cached = ReactNativeFeatureFlagsCxxInterop.passScrollToSwipeRefreshChild()
637-
passScrollToSwipeRefreshChildCache = cached
638-
}
639-
return cached
640-
}
641-
642632
override fun perfIssuesEnabled(): Boolean {
643633
var cached = perfIssuesEnabledCache
644634
if (cached == null) {

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsCxxInterop.kt‎

Lines changed: 1 addition & 3 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<<d39b29af72f9e1830af35d856952e317>>
7+
* @generated SignedSource<<6410500cbf5a05b1f34efd12d1e83bdf>>
88
*/
99

1010
/**
@@ -146,8 +146,6 @@ public object ReactNativeFeatureFlagsCxxInterop {
146146

147147
@DoNotStrip @JvmStatic public external fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean
148148

149-
@DoNotStrip @JvmStatic public external fun passScrollToSwipeRefreshChild(): Boolean
150-
151149
@DoNotStrip @JvmStatic public external fun perfIssuesEnabled(): Boolean
152150

153151
@DoNotStrip @JvmStatic public external fun perfMonitorV2Enabled(): Boolean

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsDefaults.kt‎

Lines changed: 1 addition & 3 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<<293c71559a8101698003f517a98af514>>
7+
* @generated SignedSource<<6c664176cf41ffb9f2bf820f15ed7463>>
88
*/
99

1010
/**
@@ -141,8 +141,6 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
141141

142142
override fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean = false
143143

144-
override fun passScrollToSwipeRefreshChild(): Boolean = false
145-
146144
override fun perfIssuesEnabled(): Boolean = false
147145

148146
override fun perfMonitorV2Enabled(): Boolean = false

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsLocalAccessor.kt‎

Lines changed: 1 addition & 12 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<<0f1bedf79aaaddc0ff69155ad4593ad3>>
7+
* @generated SignedSource<<1403b30f4dc3d18f39303d91d6824bda>>
88
*/
99

1010
/**
@@ -83,7 +83,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
8383
private var fuseboxNetworkInspectionEnabledCache: Boolean? = null
8484
private var hideOffscreenVirtualViewsOnIOSCache: Boolean? = null
8585
private var overrideBySynchronousMountPropsAtMountingAndroidCache: Boolean? = null
86-
private var passScrollToSwipeRefreshChildCache: Boolean? = null
8786
private var perfIssuesEnabledCache: Boolean? = null
8887
private var perfMonitorV2EnabledCache: Boolean? = null
8988
private var preparedTextCacheSizeCache: Double? = null
@@ -693,16 +692,6 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
693692
return cached
694693
}
695694

696-
override fun passScrollToSwipeRefreshChild(): Boolean {
697-
var cached = passScrollToSwipeRefreshChildCache
698-
if (cached == null) {
699-
cached = currentProvider.passScrollToSwipeRefreshChild()
700-
accessedFeatureFlags.add("passScrollToSwipeRefreshChild")
701-
passScrollToSwipeRefreshChildCache = cached
702-
}
703-
return cached
704-
}
705-
706695
override fun perfIssuesEnabled(): Boolean {
707696
var cached = perfIssuesEnabledCache
708697
if (cached == null) {

‎packages/react-native/ReactAndroid/src/main/java/com/facebook/react/internal/featureflags/ReactNativeFeatureFlagsProvider.kt‎

Lines changed: 1 addition & 3 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<<85087ed95d67c12c6ac8dbf433284d1d>>
7+
* @generated SignedSource<<ad478388cb9a64690c71fe8fa06c1c79>>
88
*/
99

1010
/**
@@ -141,8 +141,6 @@ public interface ReactNativeFeatureFlagsProvider {
141141

142142
@DoNotStrip public fun overrideBySynchronousMountPropsAtMountingAndroid(): Boolean
143143

144-
@DoNotStrip public fun passScrollToSwipeRefreshChild(): Boolean
145-
146144
@DoNotStrip public fun perfIssuesEnabled(): Boolean
147145

148146
@DoNotStrip public fun perfMonitorV2Enabled(): Boolean

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

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,11 @@ 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.internal.featureflags.ReactNativeFeatureFlags
1615
import com.facebook.react.uimanager.PixelUtil
1716
import com.facebook.react.uimanager.events.NativeGestureUtil
1817
import kotlin.math.abs
1918

20-
/**
21-
* Basic extension of [SwipeRefreshLayout] with ReactNative-specific functionality.
22-
*
23-
* This component wraps a scrollable child (typically a ScrollView or RecyclerView) and provides
24-
* pull-to-refresh functionality. It handles touch event interception for the refresh gesture while
25-
* properly forwarding other events to its children.
26-
*/
19+
/** Basic extension of [SwipeRefreshLayout] with ReactNative-specific functionality. */
2720
public class ReactSwipeRefreshLayout(reactContext: ReactContext) :
2821
SwipeRefreshLayout(reactContext) {
2922

@@ -134,31 +127,6 @@ public class ReactSwipeRefreshLayout(reactContext: ReactContext) :
134127
return true
135128
}
136129

137-
/**
138-
* Dispatches generic motion events to children.
139-
*
140-
* This override ensures that [MotionEvent.ACTION_SCROLL] events (from joystick, scrollwheel, or
141-
* other pointing devices) are properly forwarded to child views.
142-
*/
143-
public override fun dispatchGenericMotionEvent(ev: MotionEvent): Boolean {
144-
// For ACTION_SCROLL events, dispatch to child for handling
145-
// The child ScrollView will use nested scrolling APIs to communicate with this
146-
// SwipeRefreshLayout
147-
if (
148-
ReactNativeFeatureFlags.passScrollToSwipeRefreshChild() &&
149-
ev.actionMasked == MotionEvent.ACTION_SCROLL
150-
) {
151-
val child = getChildAt(0)
152-
if (child != null) {
153-
val handled = child.dispatchGenericMotionEvent(ev)
154-
if (handled) {
155-
return true
156-
}
157-
}
158-
}
159-
return super.dispatchGenericMotionEvent(ev)
160-
}
161-
162130
private companion object {
163131
private const val DEFAULT_CIRCLE_TARGET = 64f
164132
}

‎packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.cpp‎

Lines changed: 1 addition & 15 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<<131ba2b067fb63576bbc94cfb2521d06>>
7+
* @generated SignedSource<<288cffd334fdaebf18b1bede7bb907c8>>
88
*/
99

1010
/**
@@ -393,12 +393,6 @@ class ReactNativeFeatureFlagsJavaProvider
393393
return method(javaProvider_);
394394
}
395395

396-
bool passScrollToSwipeRefreshChild() override {
397-
static const auto method =
398-
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("passScrollToSwipeRefreshChild");
399-
return method(javaProvider_);
400-
}
401-
402396
bool perfIssuesEnabled() override {
403397
static const auto method =
404398
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("perfIssuesEnabled");
@@ -806,11 +800,6 @@ bool JReactNativeFeatureFlagsCxxInterop::overrideBySynchronousMountPropsAtMounti
806800
return ReactNativeFeatureFlags::overrideBySynchronousMountPropsAtMountingAndroid();
807801
}
808802

809-
bool JReactNativeFeatureFlagsCxxInterop::passScrollToSwipeRefreshChild(
810-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
811-
return ReactNativeFeatureFlags::passScrollToSwipeRefreshChild();
812-
}
813-
814803
bool JReactNativeFeatureFlagsCxxInterop::perfIssuesEnabled(
815804
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
816805
return ReactNativeFeatureFlags::perfIssuesEnabled();
@@ -1109,9 +1098,6 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
11091098
makeNativeMethod(
11101099
"overrideBySynchronousMountPropsAtMountingAndroid",
11111100
JReactNativeFeatureFlagsCxxInterop::overrideBySynchronousMountPropsAtMountingAndroid),
1112-
makeNativeMethod(
1113-
"passScrollToSwipeRefreshChild",
1114-
JReactNativeFeatureFlagsCxxInterop::passScrollToSwipeRefreshChild),
11151101
makeNativeMethod(
11161102
"perfIssuesEnabled",
11171103
JReactNativeFeatureFlagsCxxInterop::perfIssuesEnabled),

‎packages/react-native/ReactAndroid/src/main/jni/react/featureflags/JReactNativeFeatureFlagsCxxInterop.h‎

Lines changed: 1 addition & 4 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<<c08164df224d384271a3808d8117afb5>>
7+
* @generated SignedSource<<b1325a7991f212671b02bd4072d8b555>>
88
*/
99

1010
/**
@@ -207,9 +207,6 @@ class JReactNativeFeatureFlagsCxxInterop
207207
static bool overrideBySynchronousMountPropsAtMountingAndroid(
208208
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
209209

210-
static bool passScrollToSwipeRefreshChild(
211-
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
212-
213210
static bool perfIssuesEnabled(
214211
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
215212

0 commit comments

Comments
 (0)