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: D16992488 Pulled By: sahrens fbshipit-source-id: f72a9a890d9056bb017cc5747c6f66b7c35633dd
This commit is contained in:
committed by
Facebook Github Bot
parent
41525c02a2
commit
f8a64f9d61
+10
@@ -276,4 +276,14 @@ public class ReactHorizontalScrollViewManager extends ViewGroupManager<ReactHori
|
||||
public void setPersistentScrollbar(ReactHorizontalScrollView view, boolean value) {
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "horizontalFadingEdgesEnabled")
|
||||
public void setHorizontalFadingEdgesEnabled(ReactHorizontalScrollView view, boolean value) {
|
||||
view.setHorizontalFadingEdgeEnabled(value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "fadingEdgeLength")
|
||||
public void setFadingEdgeLength(ReactHorizontalScrollView view, int value) {
|
||||
view.setFadingEdgeLength(value);
|
||||
}
|
||||
}
|
||||
|
||||
+10
@@ -278,6 +278,16 @@ public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView>
|
||||
view.setScrollbarFadingEnabled(!value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "verticalFadingEdgesEnabled")
|
||||
public void setVerticalFadingEdgesEnabled(ReactScrollView view, boolean value) {
|
||||
view.setVerticalFadingEdgeEnabled(value);
|
||||
}
|
||||
|
||||
@ReactProp(name = "fadingEdgeLength")
|
||||
public void setFadingEdgeLength(ReactScrollView view, int value) {
|
||||
view.setFadingEdgeLength(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable Map<String, Object> getExportedCustomDirectEventTypeConstants() {
|
||||
return createExportedCustomDirectEventTypeConstants();
|
||||
|
||||
Reference in New Issue
Block a user