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.
mZIndexHash
PROP_TEST_ID
Constructor and Description |
---|
ReactScrollViewManager() |
ReactScrollViewManager(FpsListener fpsListener) |
Modifier and Type | Method and Description |
---|---|
static java.util.Map |
createExportedCustomDirectEventTypeConstants() |
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 |
setBottomFillColor(ReactScrollView view,
int color)
When set, fills the rest of the scrollview with a color to avoid setting a background and
creating unnecessary overdraw.
|
void |
setRemoveClippedSubviews(ReactScrollView view,
boolean removeClippedSubviews) |
void |
setScrollEnabled(ReactScrollView view,
boolean value) |
void |
setScrollPerfTag(ReactScrollView view,
java.lang.String scrollPerfTag)
Tag used for logging scroll performance on this scroll view.
|
void |
setSendMomentumEvents(ReactScrollView view,
boolean sendMomentumEvents)
Computing momentum events is potentially expensive since we post a runnable on the UI thread
to see when it is done.
|
void |
setShowsVerticalScrollIndicator(ReactScrollView view,
boolean value) |
addView, addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, needsCustomLayoutForChildren, removeAllViews, removeView, removeViewAt, reorderChildrenByZIndex, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setElevation, setImportantForAccessibility, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndex
addEventEmitters, createView, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updateProperties
public ReactScrollViewManager()
public ReactScrollViewManager(@Nullable FpsListener fpsListener)
public java.lang.String getName()
getName
in class ViewManager<ReactScrollView,LayoutShadowNode>
public ReactScrollView createViewInstance(ThemedReactContext context)
ViewManager
createViewInstance
in class ViewManager<ReactScrollView,LayoutShadowNode>
public void setScrollEnabled(ReactScrollView view, boolean value)
public void setShowsVerticalScrollIndicator(ReactScrollView view, boolean value)
public void setRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews)
public void setSendMomentumEvents(ReactScrollView view, boolean sendMomentumEvents)
view
- sendMomentumEvents
- public void setScrollPerfTag(ReactScrollView view, java.lang.String scrollPerfTag)
view
- scrollPerfTag
- public void setBottomFillColor(ReactScrollView view, int color)
view
- color
- @Nullable public java.util.Map<java.lang.String,java.lang.Integer> getCommandsMap()
ViewManager
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
.
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)
ViewManager
UIManager
. 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>
@Nullable public java.util.Map getExportedCustomDirectEventTypeConstants()
ViewManager
getExportedCustomDirectEventTypeConstants
in class ViewManager<ReactScrollView,LayoutShadowNode>
public static java.util.Map createExportedCustomDirectEventTypeConstants()