Skip to content

Commit 01e588e

Browse files
zeyapfacebook-github-bot
authored andcommitted
create feature flag responderTerminateOnScrollAndroid
Summary: ## Changelog: [Internal] [Added] - create feature flag responderTerminateOnScrollAndroid Differential Revision: D83584280
1 parent e091759 commit 01e588e

20 files changed

+156
-39
lines changed

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

Lines changed: 7 additions & 1 deletion
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<<8af0aea8bbf4cffaad7d312032bef0e4>>
7+
* @generated SignedSource<<bff2b41ec9f2f66e66d97e2172da78e9>>
88
*/
99

1010
/**
@@ -378,6 +378,12 @@ public object ReactNativeFeatureFlags {
378378
@JvmStatic
379379
public fun preventShadowTreeCommitExhaustion(): Boolean = accessor.preventShadowTreeCommitExhaustion()
380380

381+
/**
382+
* Do not emit touchcancel from Android ScrollView, instead responder system will terminate responder at scroll.
383+
*/
384+
@JvmStatic
385+
public fun responderTerminateOnScrollAndroid(): Boolean = accessor.responderTerminateOnScrollAndroid()
386+
381387
/**
382388
* Function used to enable / disable Pressibility from using W3C Pointer Events for its hover callbacks
383389
*/

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

Lines changed: 11 additions & 1 deletion
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<<5c2aa1e15e7fbe129b8f774d2dc7be70>>
7+
* @generated SignedSource<<f4fb4b7019c689ae42351808e695ef31>>
88
*/
99

1010
/**
@@ -78,6 +78,7 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
7878
private var perfMonitorV2EnabledCache: Boolean? = null
7979
private var preparedTextCacheSizeCache: Double? = null
8080
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
81+
private var responderTerminateOnScrollAndroidCache: Boolean? = null
8182
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
8283
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
8384
private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null
@@ -620,6 +621,15 @@ internal class ReactNativeFeatureFlagsCxxAccessor : ReactNativeFeatureFlagsAcces
620621
return cached
621622
}
622623

624+
override fun responderTerminateOnScrollAndroid(): Boolean {
625+
var cached = responderTerminateOnScrollAndroidCache
626+
if (cached == null) {
627+
cached = ReactNativeFeatureFlagsCxxInterop.responderTerminateOnScrollAndroid()
628+
responderTerminateOnScrollAndroidCache = cached
629+
}
630+
return cached
631+
}
632+
623633
override fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean {
624634
var cached = shouldPressibilityUseW3CPointerEventsForHoverCache
625635
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<0bd8796f4580322a78690ec4469c07ce>>
7+
* @generated SignedSource<<7cdccbf7dc947ab7a9dcec60dbfec5ec>>
88
*/
99

1010
/**
@@ -144,6 +144,8 @@ public object ReactNativeFeatureFlagsCxxInterop {
144144

145145
@DoNotStrip @JvmStatic public external fun preventShadowTreeCommitExhaustion(): Boolean
146146

147+
@DoNotStrip @JvmStatic public external fun responderTerminateOnScrollAndroid(): Boolean
148+
147149
@DoNotStrip @JvmStatic public external fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean
148150

149151
@DoNotStrip @JvmStatic public external fun skipActivityIdentityAssertionOnHostPause(): Boolean

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

Lines changed: 3 additions & 1 deletion
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<<7c7796cbe2722f0f6e5b2cc4ed43a0d5>>
7+
* @generated SignedSource<<258461f9d7afb39c85496fcf39f5d603>>
88
*/
99

1010
/**
@@ -139,6 +139,8 @@ public open class ReactNativeFeatureFlagsDefaults : ReactNativeFeatureFlagsProvi
139139

140140
override fun preventShadowTreeCommitExhaustion(): Boolean = false
141141

142+
override fun responderTerminateOnScrollAndroid(): Boolean = false
143+
142144
override fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean = false
143145

144146
override fun skipActivityIdentityAssertionOnHostPause(): Boolean = false

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

Lines changed: 12 additions & 1 deletion
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<<f3420de2307aab53b885fa491183d84b>>
7+
* @generated SignedSource<<198ce13b659fe826883501215f171930>>
88
*/
99

1010
/**
@@ -82,6 +82,7 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
8282
private var perfMonitorV2EnabledCache: Boolean? = null
8383
private var preparedTextCacheSizeCache: Double? = null
8484
private var preventShadowTreeCommitExhaustionCache: Boolean? = null
85+
private var responderTerminateOnScrollAndroidCache: Boolean? = null
8586
private var shouldPressibilityUseW3CPointerEventsForHoverCache: Boolean? = null
8687
private var skipActivityIdentityAssertionOnHostPauseCache: Boolean? = null
8788
private var sweepActiveTouchOnChildNativeGesturesAndroidCache: Boolean? = null
@@ -682,6 +683,16 @@ internal class ReactNativeFeatureFlagsLocalAccessor : ReactNativeFeatureFlagsAcc
682683
return cached
683684
}
684685

686+
override fun responderTerminateOnScrollAndroid(): Boolean {
687+
var cached = responderTerminateOnScrollAndroidCache
688+
if (cached == null) {
689+
cached = currentProvider.responderTerminateOnScrollAndroid()
690+
accessedFeatureFlags.add("responderTerminateOnScrollAndroid")
691+
responderTerminateOnScrollAndroidCache = cached
692+
}
693+
return cached
694+
}
695+
685696
override fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean {
686697
var cached = shouldPressibilityUseW3CPointerEventsForHoverCache
687698
if (cached == null) {

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

Lines changed: 3 additions & 1 deletion
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<<d4370bcde97d3c2b0b8d2a77e42a6031>>
7+
* @generated SignedSource<<23e23ac6e6abad1c5622429f66a33123>>
88
*/
99

1010
/**
@@ -139,6 +139,8 @@ public interface ReactNativeFeatureFlagsProvider {
139139

140140
@DoNotStrip public fun preventShadowTreeCommitExhaustion(): Boolean
141141

142+
@DoNotStrip public fun responderTerminateOnScrollAndroid(): Boolean
143+
142144
@DoNotStrip public fun shouldPressibilityUseW3CPointerEventsForHover(): Boolean
143145

144146
@DoNotStrip public fun skipActivityIdentityAssertionOnHostPause(): Boolean

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

Lines changed: 15 additions & 1 deletion
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<<740fec2589997816f17778f57b1d4abf>>
7+
* @generated SignedSource<<22bc7d566f16c63f218fed8c13cedffe>>
88
*/
99

1010
/**
@@ -387,6 +387,12 @@ class ReactNativeFeatureFlagsJavaProvider
387387
return method(javaProvider_);
388388
}
389389

390+
bool responderTerminateOnScrollAndroid() override {
391+
static const auto method =
392+
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("responderTerminateOnScrollAndroid");
393+
return method(javaProvider_);
394+
}
395+
390396
bool shouldPressibilityUseW3CPointerEventsForHover() override {
391397
static const auto method =
392398
getReactNativeFeatureFlagsProviderJavaClass()->getMethod<jboolean()>("shouldPressibilityUseW3CPointerEventsForHover");
@@ -795,6 +801,11 @@ bool JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion(
795801
return ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion();
796802
}
797803

804+
bool JReactNativeFeatureFlagsCxxInterop::responderTerminateOnScrollAndroid(
805+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
806+
return ReactNativeFeatureFlags::responderTerminateOnScrollAndroid();
807+
}
808+
798809
bool JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsForHover(
799810
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop> /*unused*/) {
800811
return ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover();
@@ -1095,6 +1106,9 @@ void JReactNativeFeatureFlagsCxxInterop::registerNatives() {
10951106
makeNativeMethod(
10961107
"preventShadowTreeCommitExhaustion",
10971108
JReactNativeFeatureFlagsCxxInterop::preventShadowTreeCommitExhaustion),
1109+
makeNativeMethod(
1110+
"responderTerminateOnScrollAndroid",
1111+
JReactNativeFeatureFlagsCxxInterop::responderTerminateOnScrollAndroid),
10981112
makeNativeMethod(
10991113
"shouldPressibilityUseW3CPointerEventsForHover",
11001114
JReactNativeFeatureFlagsCxxInterop::shouldPressibilityUseW3CPointerEventsForHover),

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

Lines changed: 4 additions & 1 deletion
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<<2d4ccbeed5ffafd40715357ff98d83b1>>
7+
* @generated SignedSource<<2c78816ee47e81d7f1a2d546eec54445>>
88
*/
99

1010
/**
@@ -204,6 +204,9 @@ class JReactNativeFeatureFlagsCxxInterop
204204
static bool preventShadowTreeCommitExhaustion(
205205
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
206206

207+
static bool responderTerminateOnScrollAndroid(
208+
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
209+
207210
static bool shouldPressibilityUseW3CPointerEventsForHover(
208211
facebook::jni::alias_ref<JReactNativeFeatureFlagsCxxInterop>);
209212

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.cpp

Lines changed: 5 additions & 1 deletion
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<<287689f62d05f2d27c146856b7857010>>
7+
* @generated SignedSource<<eaa70bab0a654728f753556ea694269a>>
88
*/
99

1010
/**
@@ -258,6 +258,10 @@ bool ReactNativeFeatureFlags::preventShadowTreeCommitExhaustion() {
258258
return getAccessor().preventShadowTreeCommitExhaustion();
259259
}
260260

261+
bool ReactNativeFeatureFlags::responderTerminateOnScrollAndroid() {
262+
return getAccessor().responderTerminateOnScrollAndroid();
263+
}
264+
261265
bool ReactNativeFeatureFlags::shouldPressibilityUseW3CPointerEventsForHover() {
262266
return getAccessor().shouldPressibilityUseW3CPointerEventsForHover();
263267
}

packages/react-native/ReactCommon/react/featureflags/ReactNativeFeatureFlags.h

Lines changed: 6 additions & 1 deletion
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<<ce76bbae9b797c6c1c9a1ceb1350f370>>
7+
* @generated SignedSource<<40ec76836495f75aac39d99cf167f8e8>>
88
*/
99

1010
/**
@@ -329,6 +329,11 @@ class ReactNativeFeatureFlags {
329329
*/
330330
RN_EXPORT static bool preventShadowTreeCommitExhaustion();
331331

332+
/**
333+
* Do not emit touchcancel from Android ScrollView, instead responder system will terminate responder at scroll.
334+
*/
335+
RN_EXPORT static bool responderTerminateOnScrollAndroid();
336+
332337
/**
333338
* Function used to enable / disable Pressibility from using W3C Pointer Events for its hover callbacks
334339
*/

0 commit comments

Comments
 (0)