mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Implement fading edges for ScrollView and it's dependent FlatList (#26163)
Summary: This should add props for enabling horizontal and vertical fading edges for Scrollview and FlatList. These fading edges are used to communicate to the user that there is more content to see. ## Changelog [Android] [Added] - fading edges props to the FlatList and ScrollView components Pull Request resolved: https://github.com/facebook/react-native/pull/26163 Test Plan: Open the React Native test app and navigate to the FlatList section. Enable the `useFadingEdges` switch and insert a number into `Fading edge length`.   Differential Revision: D17080676 Pulled By: TheSavior fbshipit-source-id: 91df629c17052d43c99145672e9084e1379a4113
This commit is contained in:
committed by
Facebook Github Bot
parent
c9ff99f18e
commit
51aacd5241
+11
@@ -276,4 +276,15 @@ public class ReactHorizontalScrollViewManager extends ViewGroupManager<ReactHori
|
||||
public void setPersistentScrollbar(ReactHorizontalScrollView view, boolean value) {
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "fadingEdgeLength")
|
||||
public void setFadingEdgeLength(ReactHorizontalScrollView view, int value) {
|
||||
if (value > 0) {
|
||||
view.setHorizontalFadingEdgeEnabled(true);
|
||||
view.setFadingEdgeLength(value);
|
||||
} else {
|
||||
view.setHorizontalFadingEdgeEnabled(false);
|
||||
view.setFadingEdgeLength(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+11
@@ -278,6 +278,17 @@ public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView>
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "fadingEdgeLength")
|
||||
public void setFadingEdgeLength(ReactScrollView view, int value) {
|
||||
if (value > 0) {
|
||||
view.setVerticalFadingEdgeEnabled(true);
|
||||
view.setFadingEdgeLength(value);
|
||||
} else {
|
||||
view.setVerticalFadingEdgeEnabled(false);
|
||||
view.setFadingEdgeLength(0);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
||||
return createExportedCustomDirectEventTypeConstants();
|
||||
|
||||
Reference in New Issue
Block a user