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.
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
PROP_SHOWS_HORIZONTAL_SCROLL_INDICATOR |
static java.lang.String |
PROP_SHOWS_VERTICAL_SCROLL_INDICATOR |
| 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 |
updateView(ReactScrollView scrollView,
CatalystStylesDiffMap props)
Subclass should use this method to populate native view with updated style properties.
|
addView, createCSSNodeInstance, getChildAt, getChildCount, needsCustomLayoutForChildren, removeView, updateExtraDataaddEventEmitters, createView, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updatePropertiespublic static final java.lang.String PROP_SHOWS_VERTICAL_SCROLL_INDICATOR
public static final java.lang.String PROP_SHOWS_HORIZONTAL_SCROLL_INDICATOR
public java.lang.String getName()
getName in class ViewManager<ReactScrollView,ReactShadowNode>public ReactScrollView createViewInstance(ThemedReactContext context)
ViewManagercreateViewInstance in class ViewManager<ReactScrollView,ReactShadowNode>public void updateView(ReactScrollView scrollView, CatalystStylesDiffMap props)
ViewManagerupdateView in class ViewGroupManager<ReactScrollView>@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,ReactShadowNode>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,ReactShadowNode>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,ReactShadowNode>