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.
NativeModule.NativeMethod
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
REACT_CLASS |
PROP_NATIVE_ID, PROP_TEST_ID
METHOD_TYPE_ASYNC, METHOD_TYPE_PROMISE, METHOD_TYPE_SYNC
Constructor and Description |
---|
ReactScrollViewManager() |
ReactScrollViewManager(FpsListener fpsListener) |
Modifier and Type | Method and Description |
---|---|
static java.util.Map<java.lang.String,java.lang.Object> |
createExportedCustomDirectEventTypeConstants() |
ReactScrollView |
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
|
void |
flashScrollIndicators(ReactScrollView scrollView) |
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<java.lang.String,java.lang.Object> |
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 |
scrollToEnd(ReactScrollView scrollView,
ReactScrollViewCommandHelper.ScrollToEndCommandData data) |
void |
setBorderColor(ReactScrollView view,
int index,
java.lang.Integer color) |
void |
setBorderRadius(ReactScrollView view,
int index,
float borderRadius) |
void |
setBorderStyle(ReactScrollView view,
java.lang.String borderStyle) |
void |
setBorderWidth(ReactScrollView view,
int index,
float width) |
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 |
setOverScrollMode(ReactScrollView view,
java.lang.String value)
Controls overScroll behaviour
|
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, getViewZIndex, needsCustomLayoutForChildren, removeAllViews, removeView, removeViewAt, setViewZIndex, shouldPromoteGrandchildren, updateExtraData
setAccessibilityComponentType, setAccessibilityLabel, setAccessibilityLiveRegion, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setTestId, setTransform, setTranslateX, setTranslateY, setZIndex
addEventEmitters, createShadowNodeInstance, createView, getExportedCustomBubblingEventTypeConstants, getExportedViewConstants, getNativeProps, onAfterUpdateTransaction, onDropViewInstance, updateProperties
canOverrideExistingModule, getConstants, hasConstants, initialize, onCatalystInstanceDestroy
protected static final java.lang.String REACT_CLASS
public ReactScrollViewManager()
public ReactScrollViewManager(@Nullable FpsListener fpsListener)
public java.lang.String getName()
getName
in interface NativeModule
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, @Nullable java.lang.String scrollPerfTag)
view
- scrollPerfTag
- public void setBottomFillColor(ReactScrollView view, int color)
view
- color
- public void setOverScrollMode(ReactScrollView view, java.lang.String value)
@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 flashScrollIndicators(ReactScrollView scrollView)
flashScrollIndicators
in interface ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>
public void scrollTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
scrollTo
in interface ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>
public void setBorderRadius(ReactScrollView view, int index, float borderRadius)
public void setBorderStyle(ReactScrollView view, @Nullable java.lang.String borderStyle)
public void setBorderWidth(ReactScrollView view, int index, float width)
public void setBorderColor(ReactScrollView view, int index, java.lang.Integer color)
public void scrollToEnd(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)
scrollToEnd
in interface ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>
@Nullable public java.util.Map<java.lang.String,java.lang.Object> getExportedCustomDirectEventTypeConstants()
ViewManager
getExportedCustomDirectEventTypeConstants
in class ViewManager<ReactScrollView,LayoutShadowNode>
public static java.util.Map<java.lang.String,java.lang.Object> createExportedCustomDirectEventTypeConstants()