Package 

Class ReactHorizontalScrollView

    • Method Summary

      Modifier and Type Method Description
      void setScrollPerfTag(@Nullable() String scrollPerfTag)
      void setRemoveClippedSubviews(boolean removeClippedSubviews) Sets property {@code removeClippedSubviews} as a result of property update in JS.
      boolean getRemoveClippedSubviews() Get the current value of {@code removeClippedSubviews} property.
      void setDisableIntervalMomentum(boolean disableIntervalMomentum)
      void setSendMomentumEvents(boolean sendMomentumEvents)
      void setScrollEnabled(boolean scrollEnabled)
      void setPagingEnabled(boolean pagingEnabled)
      void setDecelerationRate(float decelerationRate)
      void setSnapInterval(int snapInterval)
      void setSnapOffsets(List<Integer> snapOffsets)
      void setSnapToStart(boolean snapToStart)
      void setSnapToEnd(boolean snapToEnd)
      void setSnapToAlignment(int snapToAlignment)
      void flashScrollIndicators()
      void setOverflow(String overflow)
      String getOverflow() Gets the overflow state of a view.
      void setOverflowInset(int left, int top, int right, int bottom) Set the overflow inset rect values which indicate the extensions to the boundaries of currentview that wraps all of its children views
      Rect getOverflowInset() Get the overflow inset rect values which indicate the extensions to the boundaries of currentview that wraps all of its children views
      void requestChildFocus(View child, View focused) Since ReactHorizontalScrollView handles layout changes on JS side, it does not callsuper.onlayout due to which mIsLayoutDirty flag in HorizontalScrollView remains true andprevents scrolling to child when requestChildFocus is called.
      void addFocusables(ArrayList<View> views, int direction, int focusableMode)
      boolean onInterceptTouchEvent(MotionEvent ev)
      boolean pageScroll(int direction)
      boolean arrowScroll(int direction)
      boolean onTouchEvent(MotionEvent ev)
      boolean executeKeyEvent(KeyEvent event)
      void fling(int velocityX)
      void updateClippingRect() Notify view that clipping area may have changed and it should recalculate the list of childrenthat should be attached/detached.
      void getClippingRect(Rect outClippingRect) Get rectangular bounds to which view is currently clipped to.
      boolean getChildVisibleRect(View child, Rect r, Point offset)
      void setEndFillColor(int color)
      void draw(Canvas canvas)
      void setBackgroundColor(int color)
      void setBorderWidth(int position, float width)
      void setBorderColor(int position, float color, float alpha)
      void setBorderRadius(float borderRadius)
      void setBorderRadius(float borderRadius, int position)
      void setBorderStyle(@Nullable() String style)
      void reactSmoothScrollTo(int x, int y) Calls `smoothScrollTo` and updates state.
      void scrollTo(int x, int y) Calls `super.scrollTo` and updates state.
      FabricViewStateManager getFabricViewStateManager()
      ReactScrollViewHelper.ReactScrollViewScrollState getReactScrollViewScrollState() Get the scroll state for the current ScrollView
      void startFlingAnimator(int start, int end) Start the fling animator that the ScrollView has to go from the start position to endposition.
      ValueAnimator getFlingAnimator() Get the fling animator that is reused for the ScrollView to handle fling animation.
      int getFlingExtrapolatedDistance(int velocityX) Get the fling distance with current velocity for prediction
      void setPointerEvents(PointerEvents pointerEvents)
      PointerEvents getPointerEvents()
      void setScrollEventThrottle(int scrollEventThrottle) Set the scroll event throttle in ms.
      int getScrollEventThrottle() Get the scroll event throttle in ms.
      void setLastScrollDispatchTime(long lastScrollDispatchTime) Set the scroll view's last dispatch time for throttling
      long getLastScrollDispatchTime() Get the scroll view dispatch time for throttling
      • Methods inherited from class android.widget.HorizontalScrollView

        addView, arrowScroll, computeScroll, dispatchKeyEvent, draw, executeKeyEvent, fling, fullScroll, getAccessibilityClassName, getLeftEdgeEffectColor, getMaxScrollAmount, getRightEdgeEffectColor, isFillViewport, isSmoothScrollingEnabled, onGenericMotionEvent, onInterceptTouchEvent, onTouchEvent, pageScroll, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestLayout, scrollTo, setEdgeEffectColor, setFillViewport, setLeftEdgeEffectColor, setRightEdgeEffectColor, setSmoothScrollingEnabled, shouldDelayChildPressedState, smoothScrollBy, smoothScrollTo
      • Methods inherited from class android.widget.FrameLayout

        generateLayoutParams, getConsiderGoneChildrenWhenMeasuring, getMeasureAllChildren, setForegroundGravity, setMeasureAllChildren
      • Methods inherited from class android.view.ViewGroup

        addChildrenForAccessibility, addExtraDataToAccessibilityNodeInfo, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, bringChildToFront, childDrawableStateChanged, childHasTransientStateChanged, clearChildFocus, clearDisappearingChildren, clearFocus, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchCreateViewTranslationRequest, dispatchDisplayHint, dispatchDragEvent, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchScrollCaptureSearch, dispatchSetActivated, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchWindowFocusChanged, dispatchWindowInsetsAnimationEnd, dispatchWindowInsetsAnimationPrepare, dispatchWindowInsetsAnimationProgress, dispatchWindowInsetsAnimationStart, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, endViewTransition, findFocus, findViewsWithText, focusSearch, focusableViewAvailable, gatherTransparentRegion, getChildAt, getChildCount, getChildMeasureSpec, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getNestedScrollAxes, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onDescendantInvalidated, onInterceptHoverEvent, onNestedFling, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onNestedScroll, onNestedScrollAccepted, onRequestSendAccessibilityEvent, onResolvePointerIcon, onStartNestedScroll, onStopNestedScroll, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setTouchscreenBlocksFocus, setTransitionGroup, setWindowInsetsAnimationCallback, showContextMenuForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class android.view.View

        addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, bringToFront, buildDrawingCache, buildLayer, callOnClick, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, checkInputConnectionProxy, clearAnimation, clearViewTranslationCallback, combineMeasuredStates, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedFling, dispatchNestedPreFling, dispatchNestedPrePerformAccessibilityAction, dispatchNestedPreScroll, dispatchNestedScroll, dispatchPopulateAccessibilityEvent, drawableHotspotChanged, findViewById, findViewWithTag, forceHasOverlappingRendering, forceLayout, generateDisplayHash, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getImportantForContentCapture, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getOverlay, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getReceiveContentMimeTypes, getResources, getRevealOnFocusHint, getRight, getRootSurfaceControl, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollCaptureHint, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateDescription, getStateListAnimator, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTouchDelegate, getTouchables, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTranslationResponse, getViewTreeObserver, getVisibility, getWidth, getWindowId, getWindowInsetsController, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasNestedScrollingParent, hasOnClickListeners, hasOnLongClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidateDrawable, invalidateOutline, isAccessibilityFocused, isAccessibilityHeading, isActivated, isAttachedToWindow, isClickable, isContextClickable, isDirty, isDrawingCacheEnabled, isDuplicateParentStateEnabled, isEnabled, isFocusable, isFocusableInTouchMode, isFocused, isFocusedByDefault, isForceDarkAllowed, isHapticFeedbackEnabled, isHardwareAccelerated, isHorizontalFadingEdgeEnabled, isHorizontalScrollBarEnabled, isHovered, isImportantForAccessibility, isImportantForAutofill, isImportantForContentCapture, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isNestedScrollingEnabled, isOpaque, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollContainer, isScrollbarFadingEnabled, isSelected, isShowingLayoutBounds, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, offsetLeftAndRight, offsetTopAndBottom, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onCreateInputConnection, onCreateViewTranslationRequest, onCreateVirtualViewTranslationRequests, onDragEvent, onDrawForeground, onFilterTouchEventForSecurity, onFinishTemporaryDetach, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideContentCaptureStructure, onProvideStructure, onProvideVirtualStructure, onReceiveContent, onRtlPropertiesChanged, onScreenStateChanged, onScrollCaptureSearch, onStartTemporaryDetach, onTrackballEvent, onViewTranslationResponse, onVirtualViewTranslationResponses, onVisibilityAggregated, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, performAccessibilityAction, performClick, performContextClick, performHapticFeedback, performLongClick, performReceiveContent, playSoundEffect, post, postDelayed, postInvalidate, postInvalidateDelayed, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocusFromTouch, requestPointerCapture, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, setAllowClickWhenDisabled, setAlpha, setAnimation, setAnimationMatrix, setAutofillHints, setAutofillId, setBackground, setBackgroundColor, setBackgroundDrawable, setBackgroundResource, setBackgroundTintBlendMode, setBackgroundTintList, setBackgroundTintMode, setBottom, setCameraDistance, setClickable, setClipBounds, setClipToOutline, setContentCaptureSession, setContentDescription, setContextClickable, setDefaultFocusHighlightEnabled, setDrawingCacheBackgroundColor, setDrawingCacheEnabled, setDrawingCacheQuality, setDuplicateParentStateEnabled, setElevation, setEnabled, setFadingEdgeLength, setFilterTouchesWhenObscured, setFitsSystemWindows, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setImportantForContentCapture, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMinimumHeight, setMinimumWidth, setNestedScrollingEnabled, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnReceiveContentListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRenderEffect, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollBarSize, setScrollBarStyle, setScrollCaptureCallback, setScrollCaptureHint, setScrollContainer, setScrollIndicators, setScrollX, setScrollY, setScrollbarFadingEnabled, setSelected, setSoundEffectsEnabled, setStateDescription, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setViewTranslationCallback, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, startActionMode, startAnimation, startDrag, startDragAndDrop, startNestedScroll, stopNestedScroll, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, updateDragShadow, willNotCacheDrawing, willNotDraw
      • Methods inherited from class com.facebook.react.views.scroll.ReactScrollViewHelper.HasFlingAnimator

        getFlingExtrapolatedDistance
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReactHorizontalScrollView

        ReactHorizontalScrollView(Context context)
      • ReactHorizontalScrollView

        ReactHorizontalScrollView(Context context, FpsListener fpsListener)
    • Method Detail

      • setRemoveClippedSubviews

         void setRemoveClippedSubviews(boolean removeClippedSubviews)

        Sets property {@code removeClippedSubviews} as a result of property update in JS. Should becalled only from @{link ViewManager#updateView} method.

        Helper method applyRemoveClippedSubviewsProperty may beused by ViewManager subclass to apply this property based on property update map .

      • getRemoveClippedSubviews

         boolean getRemoveClippedSubviews()

        Get the current value of {@code removeClippedSubviews} property.

      • setOverflowInset

         void setOverflowInset(int left, int top, int right, int bottom)

        Set the overflow inset rect values which indicate the extensions to the boundaries of currentview that wraps all of its children views

      • getOverflowInset

         Rect getOverflowInset()

        Get the overflow inset rect values which indicate the extensions to the boundaries of currentview that wraps all of its children views

      • requestChildFocus

         void requestChildFocus(View child, View focused)

        Since ReactHorizontalScrollView handles layout changes on JS side, it does not callsuper.onlayout due to which mIsLayoutDirty flag in HorizontalScrollView remains true andprevents scrolling to child when requestChildFocus is called. Overriding this method andscrolling to child without checking any layout dirty flag. This will fix focus navigation issuefor KeyEvents which are not handled in HorizontalScrollView, for example: KEYCODE_TAB.

      • fling

         void fling(int velocityX)
      • updateClippingRect

         void updateClippingRect()

        Notify view that clipping area may have changed and it should recalculate the list of childrenthat should be attached/detached. This method should be called only when property {@code * removeClippedSubviews} is set to {@code true} on a view.

        CAUTION: Views are responsible for calling updateClippingRect on it's children.This should happen if child implement ReactClippingViewGroup, return true from and clipping rect change of the current view may affect clippingrect of this child.

      • getClippingRect

         void getClippingRect(Rect outClippingRect)

        Get rectangular bounds to which view is currently clipped to. Called only on views that has set {@code removeCLippedSubviews} property value to {@code true}.

        Parameters:
        outClippingRect - output clipping rect should be written to this object.
      • setBorderColor

         void setBorderColor(int position, float color, float alpha)
      • reactSmoothScrollTo

         void reactSmoothScrollTo(int x, int y)

        Calls `smoothScrollTo` and updates state.

        `smoothScrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync betweenscroll view and state. Calling raw `smoothScrollTo` doesn't update state.

      • scrollTo

         void scrollTo(int x, int y)

        Calls `super.scrollTo` and updates state.

        `super.scrollTo` changes `contentOffset` and we need to keep `contentOffset` in sync betweenscroll view and state.

        Note that while we can override scrollTo, we *cannot* override `smoothScrollTo` because itis final. See `reactSmoothScrollTo`.

      • startFlingAnimator

         void startFlingAnimator(int start, int end)

        Start the fling animator that the ScrollView has to go from the start position to endposition.

      • setScrollEventThrottle

         void setScrollEventThrottle(int scrollEventThrottle)

        Set the scroll event throttle in ms. This number is used to throttle the scroll events. Thedefault value is zero, which means the scroll events are sent with no throttle.

      • setLastScrollDispatchTime

         void setLastScrollDispatchTime(long lastScrollDispatchTime)

        Set the scroll view's last dispatch time for throttling