-
- All Implemented Interfaces:
-
android.graphics.drawable.Drawable.Callback,android.view.KeyEvent.Callback,android.view.View.OnLayoutChangeListener,android.view.ViewGroup.OnHierarchyChangeListener,android.view.ViewManager,android.view.ViewParent,android.view.accessibility.AccessibilityEventSource,com.facebook.react.uimanager.FabricViewStateManager.HasFabricViewStateManager,com.facebook.react.uimanager.ReactClippingViewGroup,com.facebook.react.uimanager.ReactOverflowView,com.facebook.react.uimanager.ReactOverflowViewWithInset,com.facebook.react.views.scroll.ReactScrollViewHelper.HasFlingAnimator,com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollEventThrottle,com.facebook.react.views.scroll.ReactScrollViewHelper.HasScrollState
public class ReactScrollView extends ScrollView implements ReactClippingViewGroup, ViewGroup.OnHierarchyChangeListener, View.OnLayoutChangeListener, FabricViewStateManager.HasFabricViewStateManager, ReactOverflowViewWithInset, ReactScrollViewHelper.HasScrollState, ReactScrollViewHelper.HasFlingAnimator, ReactScrollViewHelper.HasScrollEventThrottle
A simple subclass of ScrollView that doesn't dispatch measure and layout to its children and has a scroll listener to send scroll events to JS.
ReactScrollView only supports vertical scrolling. For horizontal scrolling, use .
-
-
Constructor Summary
Constructors Constructor Description ReactScrollView(Context context)ReactScrollView(Context context, FpsListener fpsListener)
-
Method Summary
Modifier and Type Method Description voidonInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)voidsetDisableIntervalMomentum(boolean disableIntervalMomentum)voidsetSendMomentumEvents(boolean sendMomentumEvents)voidsetScrollPerfTag(@Nullable() String scrollPerfTag)voidsetScrollEnabled(boolean scrollEnabled)voidsetPagingEnabled(boolean pagingEnabled)voidsetDecelerationRate(float decelerationRate)voidsetSnapInterval(int snapInterval)voidsetSnapOffsets(List<Integer> snapOffsets)voidsetSnapToStart(boolean snapToStart)voidsetSnapToEnd(boolean snapToEnd)voidsetSnapToAlignment(int snapToAlignment)voidflashScrollIndicators()voidsetOverflow(String overflow)StringgetOverflow()Gets the overflow state of a view. voidsetOverflowInset(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 RectgetOverflowInset()Get the overflow inset rect values which indicate the extensions to the boundaries of currentview that wraps all of its children views voidrequestChildFocus(View child, View focused)Since ReactScrollView handles layout changes on JS side, it does not call super.onlayout due towhich mIsLayoutDirty flag in ScrollView remains true and prevents scrolling to child whenrequestChildFocus is called. booleanonInterceptTouchEvent(MotionEvent ev)booleanonTouchEvent(MotionEvent ev)booleanexecuteKeyEvent(KeyEvent event)voidsetRemoveClippedSubviews(boolean removeClippedSubviews)Sets property {@code removeClippedSubviews}as a result of property update in JS.booleangetRemoveClippedSubviews()Get the current value of {@code removeClippedSubviews}property.voidupdateClippingRect()Notify view that clipping area may have changed and it should recalculate the list of childrenthat should be attached/detached. voidgetClippingRect(Rect outClippingRect)Get rectangular bounds to which view is currently clipped to. booleangetChildVisibleRect(View child, Rect r, Point offset)voidfling(int velocityY)voiddraw(Canvas canvas)voidsetEndFillColor(int color)voidonChildViewAdded(View parent, View child)voidonChildViewRemoved(View parent, View child)voidreactSmoothScrollTo(int x, int y)Calls `smoothScrollTo` and updates state. voidscrollTo(int x, int y)Calls `super.scrollTo` and updates state. voidonLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)Called when a mContentView's layout has changed. voidsetBackgroundColor(int color)voidsetBorderWidth(int position, float width)voidsetBorderColor(int position, float color, float alpha)voidsetBorderRadius(float borderRadius)voidsetBorderRadius(float borderRadius, int position)voidsetBorderStyle(@Nullable() String style)voidsetScrollAwayTopPaddingEnabledUnstable(int topPadding)ScrollAway: This enables a natively-controlled navbar that optionally obscures the top contentof the ScrollView. FabricViewStateManagergetFabricViewStateManager()ReactScrollViewHelper.ReactScrollViewScrollStategetReactScrollViewScrollState()Get the scroll state for the current ScrollView voidstartFlingAnimator(int start, int end)Start the fling animator that the ScrollView has to go from the start position to endposition. ValueAnimatorgetFlingAnimator()Get the fling animator that is reused for the ScrollView to handle fling animation. intgetFlingExtrapolatedDistance(int velocityY)Get the fling distance with current velocity for prediction voidsetPointerEvents(PointerEvents pointerEvents)PointerEventsgetPointerEvents()voidsetScrollEventThrottle(int scrollEventThrottle)Set the scroll event throttle in ms. intgetScrollEventThrottle()Get the scroll event throttle in ms. voidsetLastScrollDispatchTime(long lastScrollDispatchTime)Set the scroll view's last dispatch time for throttling longgetLastScrollDispatchTime()Get the scroll view dispatch time for throttling -
Methods inherited from class android.widget.ScrollView
addView, arrowScroll, computeScroll, dispatchKeyEvent, draw, executeKeyEvent, fling, fullScroll, getAccessibilityClassName, getBottomEdgeEffectColor, getMaxScrollAmount, getTopEdgeEffectColor, isFillViewport, isSmoothScrollingEnabled, onGenericMotionEvent, onInterceptTouchEvent, onNestedFling, onNestedScroll, onNestedScrollAccepted, onStartNestedScroll, onStopNestedScroll, onTouchEvent, pageScroll, requestChildFocus, requestChildRectangleOnScreen, requestDisallowInterceptTouchEvent, requestLayout, scrollTo, scrollToDescendant, setBottomEdgeEffectColor, setEdgeEffectColor, setFillViewport, setSmoothScrollingEnabled, setTopEdgeEffectColor, 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, onNestedPreFling, onNestedPrePerformAccessibilityAction, onNestedPreScroll, onRequestSendAccessibilityEvent, onResolvePointerIcon, 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 android.view.ViewGroup.OnHierarchyChangeListener
onChildViewAdded, onChildViewRemoved -
Methods inherited from class android.view.View.OnLayoutChangeListener
onLayoutChange -
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
-
ReactScrollView
ReactScrollView(Context context)
-
ReactScrollView
ReactScrollView(Context context, FpsListener fpsListener)
-
-
Method Detail
-
onInitializeAccessibilityNodeInfo
void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info)
-
setDisableIntervalMomentum
void setDisableIntervalMomentum(boolean disableIntervalMomentum)
-
setSendMomentumEvents
void setSendMomentumEvents(boolean sendMomentumEvents)
-
setScrollPerfTag
void setScrollPerfTag(@Nullable() String scrollPerfTag)
-
setScrollEnabled
void setScrollEnabled(boolean scrollEnabled)
-
setPagingEnabled
void setPagingEnabled(boolean pagingEnabled)
-
setDecelerationRate
void setDecelerationRate(float decelerationRate)
-
setSnapInterval
void setSnapInterval(int snapInterval)
-
setSnapOffsets
void setSnapOffsets(List<Integer> snapOffsets)
-
setSnapToStart
void setSnapToStart(boolean snapToStart)
-
setSnapToEnd
void setSnapToEnd(boolean snapToEnd)
-
setSnapToAlignment
void setSnapToAlignment(int snapToAlignment)
-
flashScrollIndicators
void flashScrollIndicators()
-
setOverflow
void setOverflow(String overflow)
-
getOverflow
@Nullable() String getOverflow()
-
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 ReactScrollView handles layout changes on JS side, it does not call super.onlayout due towhich mIsLayoutDirty flag in ScrollView remains true and prevents scrolling to child whenrequestChildFocus is called. Overriding this method and scrolling to child without checking anylayout dirty flag. This will fix focus navigation issue for KeyEvents which are not handled byScrollView, for example: KEYCODE_TAB.
-
onInterceptTouchEvent
boolean onInterceptTouchEvent(MotionEvent ev)
-
onTouchEvent
boolean onTouchEvent(MotionEvent ev)
-
executeKeyEvent
boolean executeKeyEvent(KeyEvent event)
-
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.
-
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.
-
getChildVisibleRect
boolean getChildVisibleRect(View child, Rect r, Point offset)
-
fling
void fling(int velocityY)
-
setEndFillColor
void setEndFillColor(int color)
-
onChildViewAdded
void onChildViewAdded(View parent, View child)
-
onChildViewRemoved
void onChildViewRemoved(View parent, View child)
-
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`.
-
onLayoutChange
void onLayoutChange(View v, int left, int top, int right, int bottom, int oldLeft, int oldTop, int oldRight, int oldBottom)
Called when a mContentView's layout has changed. Fixes the scroll position if it's too largeafter the content resizes. Without this, the user would see a blank ScrollView when the scrollposition is larger than the ScrollView's max scroll position after the content shrinks.
-
setBackgroundColor
void setBackgroundColor(int color)
-
setBorderWidth
void setBorderWidth(int position, float width)
-
setBorderColor
void setBorderColor(int position, float color, float alpha)
-
setBorderRadius
void setBorderRadius(float borderRadius)
-
setBorderRadius
void setBorderRadius(float borderRadius, int position)
-
setBorderStyle
void setBorderStyle(@Nullable() String style)
-
setScrollAwayTopPaddingEnabledUnstable
void setScrollAwayTopPaddingEnabledUnstable(int topPadding)
ScrollAway: This enables a natively-controlled navbar that optionally obscures the top contentof the ScrollView. Whether or not the navbar is obscuring the React Native surface isdetermined outside of React Native.
Note: all ScrollViews and HorizontalScrollViews in React have exactly one child: the"content" View (see ScrollView.js). That View is non-collapsable so it will never beView-flattened away. However, it is possible to pass custom styles into that View.
If you are using this feature it is assumed that you have full control over this ScrollViewand that you are **not** overriding the ScrollView content view to pass in a `translateY`style. `translateY` must never be set from ReactJS while using this feature!
-
getFabricViewStateManager
FabricViewStateManager getFabricViewStateManager()
-
getReactScrollViewScrollState
ReactScrollViewHelper.ReactScrollViewScrollState getReactScrollViewScrollState()
Get the scroll state for the current ScrollView
-
startFlingAnimator
void startFlingAnimator(int start, int end)
Start the fling animator that the ScrollView has to go from the start position to endposition.
-
getFlingAnimator
ValueAnimator getFlingAnimator()
Get the fling animator that is reused for the ScrollView to handle fling animation.
-
getFlingExtrapolatedDistance
int getFlingExtrapolatedDistance(int velocityY)
Get the fling distance with current velocity for prediction
-
setPointerEvents
void setPointerEvents(PointerEvents pointerEvents)
-
getPointerEvents
PointerEvents getPointerEvents()
-
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.
-
getScrollEventThrottle
int getScrollEventThrottle()
Get the scroll event throttle in ms.
-
setLastScrollDispatchTime
void setLastScrollDispatchTime(long lastScrollDispatchTime)
Set the scroll view's last dispatch time for throttling
-
getLastScrollDispatchTime
long getLastScrollDispatchTime()
Get the scroll view dispatch time for throttling
-
-
-
-