-
- 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 ReactHorizontalScrollViewManager extends ViewGroupManager<ReactHorizontalScrollView> implements ReactScrollViewCommandHelper.ScrollCommandHandler<ReactHorizontalScrollView>
View manager for ReactHorizontalScrollView 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 ReactHorizontalScrollViewManager()ReactHorizontalScrollViewManager(FpsListener fpsListener)
-
Method Summary
Modifier and Type Method Description StringgetName()ReactHorizontalScrollViewcreateViewInstance(ThemedReactContext context)Subclasses should return a new View instance of the proper type. ObjectupdateState(ReactHorizontalScrollView view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)Subclasses can implement this method to receive state updates shared between all instances ofthis component type. voidsetScrollEnabled(ReactHorizontalScrollView view, boolean value)voidsetShowsHorizontalScrollIndicator(ReactHorizontalScrollView view, boolean value)voidsetDecelerationRate(ReactHorizontalScrollView view, float decelerationRate)voidsetDisableIntervalMomentum(ReactHorizontalScrollView view, boolean disbaleIntervalMomentum)voidsetSnapToInterval(ReactHorizontalScrollView view, float snapToInterval)voidsetSnapToAlignment(ReactHorizontalScrollView view, String alignment)voidsetSnapToOffsets(ReactHorizontalScrollView view, @Nullable() ReadableArray snapToOffsets)voidsetSnapToStart(ReactHorizontalScrollView view, boolean snapToStart)voidsetSnapToEnd(ReactHorizontalScrollView view, boolean snapToEnd)voidsetRemoveClippedSubviews(ReactHorizontalScrollView view, boolean removeClippedSubviews)voidsetSendMomentumEvents(ReactHorizontalScrollView view, boolean sendMomentumEvents)Computing momentum events is potentially expensive since we post a runnable on the UI thread tosee when it is done. voidsetScrollPerfTag(ReactHorizontalScrollView view, String scrollPerfTag)Tag used for logging scroll performance on this scroll view. voidsetPagingEnabled(ReactHorizontalScrollView view, boolean pagingEnabled)voidsetOverScrollMode(ReactHorizontalScrollView view, String value)Controls overScroll behaviour voidsetNestedScrollEnabled(ReactHorizontalScrollView view, boolean value)voidreceiveCommand(ReactHorizontalScrollView scrollView, int commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidreceiveCommand(ReactHorizontalScrollView scrollView, String commandId, @Nullable() ReadableArray args)Subclasses may use this method to receive events/commands directly from JS through the . voidflashScrollIndicators(ReactHorizontalScrollView scrollView)voidscrollTo(ReactHorizontalScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)voidscrollToEnd(ReactHorizontalScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)voidsetBottomFillColor(ReactHorizontalScrollView view, int color)When set, fills the rest of the scrollview with a color to avoid setting a background andcreating unnecessary overdraw. voidsetBorderRadius(ReactHorizontalScrollView view, int index, float borderRadius)voidsetBorderStyle(ReactHorizontalScrollView view, @Nullable() String borderStyle)voidsetBorderWidth(ReactHorizontalScrollView view, int index, float width)voidsetBorderColor(ReactHorizontalScrollView view, int index, Integer color)voidsetOverflow(ReactHorizontalScrollView view, @Nullable() String overflow)voidsetPersistentScrollbar(ReactHorizontalScrollView view, boolean value)voidsetFadingEdgeLength(ReactHorizontalScrollView view, int value)voidsetContentOffset(ReactHorizontalScrollView view, ReadableMap value)voidsetPointerEvents(ReactHorizontalScrollView view, @Nullable() String pointerEventsStr)voidsetScrollEventThrottle(ReactHorizontalScrollView 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, getExportedCustomDirectEventTypeConstants, 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, getCommandsMap, 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
-
ReactHorizontalScrollViewManager
ReactHorizontalScrollViewManager()
-
ReactHorizontalScrollViewManager
ReactHorizontalScrollViewManager(FpsListener fpsListener)
-
-
Method Detail
-
createViewInstance
ReactHorizontalScrollView createViewInstance(ThemedReactContext context)
Subclasses should return a new View instance of the proper type.
-
updateState
Object updateState(ReactHorizontalScrollView view, ReactStylesDiffMap props, @Nullable() StateWrapper stateWrapper)
Subclasses can implement this method to receive state updates shared between all instances ofthis component type.
-
setScrollEnabled
void setScrollEnabled(ReactHorizontalScrollView view, boolean value)
-
setShowsHorizontalScrollIndicator
void setShowsHorizontalScrollIndicator(ReactHorizontalScrollView view, boolean value)
-
setDecelerationRate
void setDecelerationRate(ReactHorizontalScrollView view, float decelerationRate)
-
setDisableIntervalMomentum
void setDisableIntervalMomentum(ReactHorizontalScrollView view, boolean disbaleIntervalMomentum)
-
setSnapToInterval
void setSnapToInterval(ReactHorizontalScrollView view, float snapToInterval)
-
setSnapToAlignment
void setSnapToAlignment(ReactHorizontalScrollView view, String alignment)
-
setSnapToOffsets
void setSnapToOffsets(ReactHorizontalScrollView view, @Nullable() ReadableArray snapToOffsets)
-
setSnapToStart
void setSnapToStart(ReactHorizontalScrollView view, boolean snapToStart)
-
setSnapToEnd
void setSnapToEnd(ReactHorizontalScrollView view, boolean snapToEnd)
-
setRemoveClippedSubviews
void setRemoveClippedSubviews(ReactHorizontalScrollView view, boolean removeClippedSubviews)
-
setSendMomentumEvents
void setSendMomentumEvents(ReactHorizontalScrollView 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(ReactHorizontalScrollView view, String scrollPerfTag)
Tag used for logging scroll performance on this scroll view. Will force momentum events to beturned on (see setSendMomentumEvents).
-
setPagingEnabled
void setPagingEnabled(ReactHorizontalScrollView view, boolean pagingEnabled)
-
setOverScrollMode
void setOverScrollMode(ReactHorizontalScrollView view, String value)
Controls overScroll behaviour
-
setNestedScrollEnabled
void setNestedScrollEnabled(ReactHorizontalScrollView view, boolean value)
-
receiveCommand
void receiveCommand(ReactHorizontalScrollView 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(ReactHorizontalScrollView 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(ReactHorizontalScrollView scrollView)
-
scrollTo
void scrollTo(ReactHorizontalScrollView scrollView, ReactScrollViewCommandHelper.ScrollToCommandData data)
-
scrollToEnd
void scrollToEnd(ReactHorizontalScrollView scrollView, ReactScrollViewCommandHelper.ScrollToEndCommandData data)
-
setBottomFillColor
void setBottomFillColor(ReactHorizontalScrollView view, int color)
When set, fills the rest of the scrollview with a color to avoid setting a background andcreating unnecessary overdraw.
-
setBorderRadius
void setBorderRadius(ReactHorizontalScrollView view, int index, float borderRadius)
-
setBorderStyle
void setBorderStyle(ReactHorizontalScrollView view, @Nullable() String borderStyle)
-
setBorderWidth
void setBorderWidth(ReactHorizontalScrollView view, int index, float width)
-
setBorderColor
void setBorderColor(ReactHorizontalScrollView view, int index, Integer color)
-
setOverflow
void setOverflow(ReactHorizontalScrollView view, @Nullable() String overflow)
-
setPersistentScrollbar
void setPersistentScrollbar(ReactHorizontalScrollView view, boolean value)
-
setFadingEdgeLength
void setFadingEdgeLength(ReactHorizontalScrollView view, int value)
-
setContentOffset
void setContentOffset(ReactHorizontalScrollView view, ReadableMap value)
-
setPointerEvents
void setPointerEvents(ReactHorizontalScrollView view, @Nullable() String pointerEventsStr)
-
setScrollEventThrottle
void setScrollEventThrottle(ReactHorizontalScrollView view, int scrollEventThrottle)
-
-
-
-