Skip to content

Commit 2ab23ae

Browse files
Nick Lefevermeta-codesync[bot]
authored andcommitted
Add fadingEdgeLength prop to android scroll view props (facebook#54164)
Summary: Pull Request resolved: facebook#54164 Adding `fadingEdgeLength` prop to the Android scroll view props together with prop diffing support for Props 2.0. Changelog: [Internal] Differential Revision: D84788963 fbshipit-source-id: 6cf8011816311797fe0d805f68ccb026e32d7bff
1 parent e79920c commit 2ab23ae

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

packages/react-native/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,16 @@ HostPlatformScrollViewProps::HostPlatformScrollViewProps(
3838
rawProps,
3939
"nestedScrollEnabled",
4040
sourceProps.nestedScrollEnabled,
41-
true))
41+
true)),
42+
fadingEdgeLength(
43+
ReactNativeFeatureFlags::enableCppPropsIteratorSetter()
44+
? sourceProps.fadingEdgeLength
45+
: convertRawProp(
46+
context,
47+
rawProps,
48+
"fadingEdgeLength",
49+
sourceProps.fadingEdgeLength,
50+
nullptr))
4251

4352
{}
4453

@@ -57,6 +66,7 @@ void HostPlatformScrollViewProps::setProp(
5766
switch (hash) {
5867
RAW_SET_PROP_SWITCH_CASE_BASIC(sendMomentumEvents);
5968
RAW_SET_PROP_SWITCH_CASE_BASIC(nestedScrollEnabled);
69+
RAW_SET_PROP_SWITCH_CASE_BASIC(fadingEdgeLength);
6070
}
6171
}
6272

@@ -348,6 +358,10 @@ folly::dynamic HostPlatformScrollViewProps::getDiffProps(
348358
result["nestedScrollEnabled"] = nestedScrollEnabled;
349359
}
350360

361+
if (fadingEdgeLength != oldProps->fadingEdgeLength) {
362+
result["fadingEdgeLength"] = fadingEdgeLength;
363+
}
364+
351365
return result;
352366
}
353367

packages/react-native/ReactCommon/react/renderer/components/scrollview/platform/android/react/renderer/components/scrollview/HostPlatformScrollViewProps.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ class HostPlatformScrollViewProps : public BaseScrollViewProps {
3232

3333
bool sendMomentumEvents{};
3434
bool nestedScrollEnabled{};
35+
folly::dynamic fadingEdgeLength{};
3536

3637
#pragma mark - DebugStringConvertible
3738

0 commit comments

Comments
 (0)