public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView> implements ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>
ReactScrollView components.
Note that ReactScrollView and ReactHorizontalScrollView are exposed to JS
as a single ScrollView component, configured via the horizontal boolean property.
PROP_TEST_ID| Constructor and Description |
|---|
ReactScrollViewManager() |
| Modifier and Type | Method and Description |
|---|---|
ReactScrollView |
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
|
java.util.Map<java.lang.String,java.lang.Integer> |
getCommandsMap()
Subclasses of
ViewManager that expect to receive commands through
UIManagerModule.dispatchViewManagerCommand(int, int, com.facebook.react.bridge.ReadableArray) should override this method returning the
map between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray) method
whenever the command is dispatched for this particular ViewManager. |
java.util.Map |
getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed on
native views.
|
java.lang.String |
getName() |
void |
receiveCommand(ReactScrollView scrollView,
int commandId,
ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the
UIManager. |
void |
scrollTo(ReactScrollView scrollView,
ReactScrollViewCommandHelper.ScrollToCommandData data) |
void |
scrollWithoutAnimationTo(ReactScrollView scrollView,
ReactScrollViewCommandHelper.ScrollToCommandData data) |
void |
setRemoveClippedSubviews(ReactScrollView view,
boolean removeClippedSubviews) |
void |
setShowsVerticalScrollIndicator(ReactScrollView view,
boolean value) |
addView, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, needsCustomLayoutForChildren, removeAllViews, removeViewAt, updateExtraDatasetAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setDecomposedMatrix, setImportantForAccessibility, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTranslateX, setTranslateYaddEventEmitters, createView, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updatePropertiespublic java.lang.String getName()
getName in class ViewManager<ReactScrollView,LayoutShadowNode>public ReactScrollView createViewInstance(ThemedReactContext context)
ViewManagercreateViewInstance in class ViewManager<ReactScrollView,LayoutShadowNode>public void setShowsVerticalScrollIndicator(ReactScrollView view, boolean value)
public void setRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews)
@Nullable public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManagerViewManager that expect to receive commands through
UIManagerModule.dispatchViewManagerCommand(int, int, com.facebook.react.bridge.ReadableArray) should override this method returning the
map between names of the commands and IDs that are then used in ViewManager.receiveCommand(T, int, com.facebook.react.bridge.ReadableArray) method
whenever the command is dispatched for this particular ViewManager.
As an example we may consider ReactWebViewManager that expose the following commands:
goBack, goForward, reload. In this case the map returned from ViewManager.getCommandsMap() from
ReactWebViewManager will look as follows:
{
"goBack": 1,
"goForward": 2,
"reload": 3,
}
Now assuming that "reload" command is dispatched through UIManagerModule we trigger
ReactWebViewManager#receiveCommand passing "3" as commandId argument.getCommandsMap in class ViewManager<ReactScrollView,LayoutShadowNode>public void receiveCommand(ReactScrollView scrollView, int commandId, @Nullable ReadableArray args)
ViewManagerUIManager. Good example of such a command would be scrollTo request with
coordinates for a ScrollView or goBack request for a WebView instance.receiveCommand in class ViewManager<ReactScrollView,LayoutShadowNode>scrollView - View instance that should receive the commandcommandId - code of the commandargs - optional arguments for the commandpublic void scrollTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
scrollTo in interface ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>public void scrollWithoutAnimationTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
scrollWithoutAnimationTo in interface ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>@Nullable public java.util.Map getExportedCustomDirectEventTypeConstants()
ViewManagergetExportedCustomDirectEventTypeConstants in class ViewManager<ReactScrollView,LayoutShadowNode>