-
- All Implemented Interfaces:
-
com.facebook.react.bridge.NativeModule,com.facebook.react.uimanager.BaseViewManagerInterface,com.facebook.react.uimanager.IViewManagerWithChildren,com.facebook.react.views.scroll.ReactScrollViewCommandHelper.ScrollCommandHandler
public class ReactScrollViewManager extends ViewGroupManager<ReactScrollView> implements ReactScrollViewCommandHelper.ScrollCommandHandler<ReactScrollView>
View manager for ReactScrollView components.
Note that ReactScrollView and ReactHorizontalScrollView are exposed to JS as a single ScrollView component, configured via the
{@code horizontal}boolean property.
-
-
Field Summary
Fields Modifier and Type Field Description public final static StringREACT_CLASS
-
Constructor Summary
Constructors Constructor Description ReactScrollViewManager()ReactScrollViewManager(FpsListener fpsListener)
-
Method Summary
Modifier and Type Method Description StringgetName()ReactScrollViewcreateViewInstance(ThemedReactContext context)Subclasses should return a new View instance of the proper type. voidsetScrollEnabled(ReactScrollView view, boolean value)voidsetShowsVerticalScrollIndicator(ReactScrollView view, boolean value)voidsetDecelerationRate(ReactScrollView view, float decelerationRate)voidsetDisableIntervalMomentum(ReactScrollView view, boolean disbaleIntervalMomentum)voidsetSnapToInterval(ReactScrollView view, float snapToInterval)voidsetSnapToOffsets(ReactScrollView view, @Nullable() ReadableArray snapToOffsets)voidsetSnapToAlignment(ReactScrollView view, String alignment)voidsetSnapToStart(ReactScrollView view, boolean snapToStart)voidsetSnapToEnd(ReactScrollView view, boolean snapToEnd)voidsetRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews)voidsetSendMomentumEvents(ReactScrollView view, boolean sendMomentumEvents)Computing momentum events is potentially expensive since we post a runnable on the UI thread tosee when it is done. voidsetScrollPerfTag(ReactScrollView view, @Nullable() String scrollPerfTag)Tag used for logging scroll performance on this scroll view. voidsetPagingEnabled(ReactScrollView view, boolean pagingEnabled)voidsetBottomFillColor(ReactScrollView view, int color)When set, fills the rest of the scrollview with a color to avoid setting a background andcreating unnecessary overdraw. voidsetOverScrollMode(ReactScrollView view, String value)Controls overScroll behaviour voidsetNestedScrollEnabled(ReactScrollView view, boolean value)Map<String, Integer>getCommandsMap()Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager. voidreceiveCommand(ReactScrollView scrollView, int commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidreceiveCommand(ReactScrollView scrollView, String commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidflashScrollIndicators(ReactScrollView scrollView)voidscrollTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)voidsetBorderRadius(ReactScrollView view, int index, float borderRadius)voidsetBorderStyle(ReactScrollView view, @Nullable() String borderStyle)voidsetBorderWidth(ReactScrollView view, int index, float width)voidsetBorderColor(ReactScrollView view, int index, Integer color)voidsetOverflow(ReactScrollView view, @Nullable() String overflow)voidscrollToEnd(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)voidsetPersistentScrollbar(ReactScrollView view, boolean value)voidsetFadingEdgeLength(ReactScrollView view, int value)voidsetContentOffset(ReactScrollView view, ReadableMap value)ObjectupdateState(ReactScrollView view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)Subclasses can implement this method to receive state updates shared between all instances ofthis component type. Map<String, Object>getExportedCustomDirectEventTypeConstants()Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. static Map<String, Object>createExportedCustomDirectEventTypeConstants()voidsetPointerEvents(ReactScrollView view, @Nullable() String pointerEventsStr)voidsetScrollEventThrottle(ReactScrollView view, int scrollEventThrottle)-
Methods inherited from class com.facebook.react.uimanager.ViewGroupManager
addView, addViews, createShadowNodeInstance, getChildAt, getChildCount, getShadowNodeClass, getViewZIndex, needsCustomLayoutForChildren, removeAllViews, removeView, removeViewAt, setViewZIndex, shouldPromoteGrandchildren, updateExtraData -
Methods inherited from class com.facebook.react.uimanager.BaseViewManager
getExportedCustomBubblingEventTypeConstants, setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setAccessibilityValue, setBackgroundColor, setBorderBottomLeftRadius, setBorderBottomRightRadius, setBorderRadius, setBorderTopLeftRadius, setBorderTopRightRadius, setElevation, setImportantForAccessibility, setMoveShouldSetResponder, setMoveShouldSetResponderCapture, setNativeId, setOpacity, setPointerEnter, setPointerLeave, setPointerMove, setRenderToHardwareTexture, setResponderEnd, setResponderGrant, setResponderMove, setResponderReject, setResponderRelease, setResponderStart, setResponderTerminate, setResponderTerminationRequest, setRotation, setScaleX, setScaleY, setShadowColor, setShouldBlockNativeResponder, setStartShouldSetResponder, setStartShouldSetResponderCapture, setTestId, setTouchCancel, setTouchEnd, setTouchMove, setTouchStart, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class com.facebook.react.uimanager.ViewManager
createShadowNodeInstance, createShadowNodeInstance, createView, getExportedViewConstants, getNativeProps, getShadowNodeClass, measure, measure, onDropViewInstance, receiveCommand, receiveCommand, setPadding, updateExtraData, updateProperties, updateState -
Methods inherited from class com.facebook.react.bridge.BaseJavaModule
canOverrideExistingModule, getConstants, hasConstants, initialize, invalidate, onCatalystInstanceDestroy -
Methods inherited from class com.facebook.react.uimanager.BaseViewManagerInterface
setAccessibilityActions, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLabelledBy, setAccessibilityLiveRegion, setAccessibilityRole, setBackgroundColor, setElevation, setImportantForAccessibility, setNativeId, setOpacity, setRenderToHardwareTexture, setRotation, setScaleX, setScaleY, setShadowColor, setTestId, setTransform, setTranslateX, setTranslateY, setViewState, setZIndex -
Methods inherited from class com.facebook.react.views.scroll.ReactScrollViewCommandHelper.ScrollCommandHandler
flashScrollIndicators, scrollTo, scrollToEnd -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
ReactScrollViewManager
ReactScrollViewManager()
-
ReactScrollViewManager
ReactScrollViewManager(FpsListener fpsListener)
-
-
Method Detail
-
createViewInstance
ReactScrollView createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
-
setScrollEnabled
void setScrollEnabled(ReactScrollView view, boolean value)
-
setShowsVerticalScrollIndicator
void setShowsVerticalScrollIndicator(ReactScrollView view, boolean value)
-
setDecelerationRate
void setDecelerationRate(ReactScrollView view, float decelerationRate)
-
setDisableIntervalMomentum
void setDisableIntervalMomentum(ReactScrollView view, boolean disbaleIntervalMomentum)
-
setSnapToInterval
void setSnapToInterval(ReactScrollView view, float snapToInterval)
-
setSnapToOffsets
void setSnapToOffsets(ReactScrollView view, @Nullable() ReadableArray snapToOffsets)
-
setSnapToAlignment
void setSnapToAlignment(ReactScrollView view, String alignment)
-
setSnapToStart
void setSnapToStart(ReactScrollView view, boolean snapToStart)
-
setSnapToEnd
void setSnapToEnd(ReactScrollView view, boolean snapToEnd)
-
setRemoveClippedSubviews
void setRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews)
-
setSendMomentumEvents
void setSendMomentumEvents(ReactScrollView view, boolean sendMomentumEvents)
Computing momentum events is potentially expensive since we post a runnable on the UI thread tosee when it is done. We only do that if {@param sendMomentumEvents} is set to true. This ishandled automatically in js by checking if there is a listener on the momentum events.
-
setScrollPerfTag
void setScrollPerfTag(ReactScrollView view, @Nullable() String scrollPerfTag)
Tag used for logging scroll performance on this scroll view. Will force momentum events to beturned on (see setSendMomentumEvents).
-
setPagingEnabled
void setPagingEnabled(ReactScrollView view, boolean pagingEnabled)
-
setBottomFillColor
void setBottomFillColor(ReactScrollView view, int color)
When set, fills the rest of the scrollview with a color to avoid setting a background andcreating unnecessary overdraw.
-
setOverScrollMode
void setOverScrollMode(ReactScrollView view, String value)
Controls overScroll behaviour
-
setNestedScrollEnabled
void setNestedScrollEnabled(ReactScrollView view, boolean value)
-
getCommandsMap
@Nullable() Map<String, Integer> getCommandsMap()
Subclasses of ViewManager that expect to receive commands through should override this method returning the mapbetween names of the commands and IDs that are then used in receiveCommand methodwhenever the command is dispatched for this particular ViewManager.
-
receiveCommand
void receiveCommand(ReactScrollView scrollView, int commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be
{@code scrollTo}request with coordinatesfor a ScrollView instance.This method is deprecated use receiveCommand instead.
- Parameters:
commandId- code of the commandargs- optional arguments for the command
-
receiveCommand
void receiveCommand(ReactScrollView scrollView, String commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . Good example of such a command would be
{@code scrollTo}request with coordinatesfor a ReactScrollView instance.- Parameters:
commandId- code of the commandargs- optional arguments for the command
-
flashScrollIndicators
void flashScrollIndicators(ReactScrollView scrollView)
-
scrollTo
void scrollTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
-
setBorderRadius
void setBorderRadius(ReactScrollView view, int index, float borderRadius)
-
setBorderStyle
void setBorderStyle(ReactScrollView view, @Nullable() String borderStyle)
-
setBorderWidth
void setBorderWidth(ReactScrollView view, int index, float width)
-
setBorderColor
void setBorderColor(ReactScrollView view, int index, Integer color)
-
setOverflow
void setOverflow(ReactScrollView view, @Nullable() String overflow)
-
scrollToEnd
void scrollToEnd(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)
-
setPersistentScrollbar
void setPersistentScrollbar(ReactScrollView view, boolean value)
-
setFadingEdgeLength
void setFadingEdgeLength(ReactScrollView view, int value)
-
setContentOffset
void setContentOffset(ReactScrollView view, ReadableMap value)
-
updateState
Object updateState(ReactScrollView view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)
Subclasses can implement this method to receive state updates shared between all instances ofthis component type.
-
getExportedCustomDirectEventTypeConstants
@Nullable() Map<String, Object> getExportedCustomDirectEventTypeConstants()
Returns a map of config data passed to JS that defines eligible events that can be placed onnative views. This should return non-bubbling directly-dispatched event types.
Returned map should be of the form:
{ "onTwirl": { "registrationName": "onTwirl" } }
-
createExportedCustomDirectEventTypeConstants
static Map<String, Object> createExportedCustomDirectEventTypeConstants()
-
setPointerEvents
void setPointerEvents(ReactScrollView view, @Nullable() String pointerEventsStr)
-
setScrollEventThrottle
void setScrollEventThrottle(ReactScrollView view, int scrollEventThrottle)
-
-
-
-