-
- 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 String
REACT_CLASS
-
Constructor Summary
Constructors Constructor Description ReactScrollViewManager()
ReactScrollViewManager(FpsListener fpsListener)
-
Method Summary
Modifier and Type Method Description String
getName()
ReactScrollView
createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type. void
setScrollEnabled(ReactScrollView view, boolean value)
void
setShowsVerticalScrollIndicator(ReactScrollView view, boolean value)
void
setDecelerationRate(ReactScrollView view, float decelerationRate)
void
setDisableIntervalMomentum(ReactScrollView view, boolean disbaleIntervalMomentum)
void
setSnapToInterval(ReactScrollView view, float snapToInterval)
void
setSnapToOffsets(ReactScrollView view, @Nullable() ReadableArray snapToOffsets)
void
setSnapToAlignment(ReactScrollView view, String alignment)
void
setSnapToStart(ReactScrollView view, boolean snapToStart)
void
setSnapToEnd(ReactScrollView view, boolean snapToEnd)
void
setRemoveClippedSubviews(ReactScrollView view, boolean removeClippedSubviews)
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. void
setScrollPerfTag(ReactScrollView view, @Nullable() String scrollPerfTag)
Tag used for logging scroll performance on this scroll view. void
setPagingEnabled(ReactScrollView view, boolean pagingEnabled)
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. void
setOverScrollMode(ReactScrollView view, String value)
Controls overScroll behaviour void
setNestedScrollEnabled(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. void
receiveCommand(ReactScrollView scrollView, int commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . void
receiveCommand(ReactScrollView scrollView, String commandId, @Nullable() ReadableArray args)
Subclasses may use this method to receive events/commands directly from JS through the . void
flashScrollIndicators(ReactScrollView scrollView)
void
scrollTo(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
void
setBorderRadius(ReactScrollView view, int index, float borderRadius)
void
setBorderStyle(ReactScrollView view, @Nullable() String borderStyle)
void
setBorderWidth(ReactScrollView view, int index, float width)
void
setBorderColor(ReactScrollView view, int index, Integer color)
void
setOverflow(ReactScrollView view, @Nullable() String overflow)
void
scrollToEnd(ReactScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)
void
setPersistentScrollbar(ReactScrollView view, boolean value)
void
setFadingEdgeLength(ReactScrollView view, int value)
void
setContentOffset(ReactScrollView view, ReadableMap value)
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. 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()
void
setPointerEvents(ReactScrollView view, @Nullable() String pointerEventsStr)
void
setScrollEventThrottle(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)
-
-
-
-