Class NestedScrollView

  • All Implemented Interfaces:
    android.graphics.drawable.Drawable.Callback, android.view.accessibility.AccessibilityEventSource, android.view.KeyEvent.Callback, android.view.ViewManager, android.view.ViewParent, androidx.core.view.NestedScrollingChild, androidx.core.view.NestedScrollingChild2, androidx.core.view.NestedScrollingParent, androidx.core.view.ScrollingView

    public class NestedScrollView
    extends android.widget.FrameLayout
    implements androidx.core.view.NestedScrollingParent, androidx.core.view.NestedScrollingChild2, androidx.core.view.ScrollingView
    NestedScrollView is just like ScrollView, but it supports acting as both a nested scrolling parent and child on both new and old versions of Android. Nested scrolling is enabled by default.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static interface  NestedScrollView.OnScrollChangeListener
      Interface definition for a callback to be invoked when the scroll X or Y positions of a view change.
      • Nested classes/interfaces inherited from class android.widget.FrameLayout

        android.widget.FrameLayout.LayoutParams
      • Nested classes/interfaces inherited from class android.view.ViewGroup

        android.view.ViewGroup.MarginLayoutParams, android.view.ViewGroup.OnHierarchyChangeListener
      • Nested classes/interfaces inherited from class android.view.View

        android.view.View.BaseSavedState, android.view.View.DragShadowBuilder, android.view.View.MeasureSpec, android.view.View.OnApplyWindowInsetsListener, android.view.View.OnAttachStateChangeListener, android.view.View.OnCapturedPointerListener, android.view.View.OnClickListener, android.view.View.OnContextClickListener, android.view.View.OnCreateContextMenuListener, android.view.View.OnDragListener, android.view.View.OnFocusChangeListener, android.view.View.OnGenericMotionListener, android.view.View.OnHoverListener, android.view.View.OnKeyListener, android.view.View.OnLayoutChangeListener, android.view.View.OnLongClickListener, android.view.View.OnSystemUiVisibilityChangeListener, android.view.View.OnTouchListener, android.view.View.OnUnhandledKeyEventListener
    • Field Summary

      • Fields inherited from class android.view.ViewGroup

        CLIP_TO_PADDING_MASK, FOCUS_AFTER_DESCENDANTS, FOCUS_BEFORE_DESCENDANTS, FOCUS_BLOCK_DESCENDANTS, LAYOUT_MODE_CLIP_BOUNDS, LAYOUT_MODE_OPTICAL_BOUNDS, PERSISTENT_ALL_CACHES, PERSISTENT_ANIMATION_CACHE, PERSISTENT_NO_CACHE, PERSISTENT_SCROLLING_CACHE
      • Fields inherited from class android.view.View

        ACCESSIBILITY_LIVE_REGION_ASSERTIVE, ACCESSIBILITY_LIVE_REGION_NONE, ACCESSIBILITY_LIVE_REGION_POLITE, ALPHA, AUTOFILL_FLAG_INCLUDE_NOT_IMPORTANT_VIEWS, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DATE, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_DAY, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_MONTH, AUTOFILL_HINT_CREDIT_CARD_EXPIRATION_YEAR, AUTOFILL_HINT_CREDIT_CARD_NUMBER, AUTOFILL_HINT_CREDIT_CARD_SECURITY_CODE, AUTOFILL_HINT_EMAIL_ADDRESS, AUTOFILL_HINT_NAME, AUTOFILL_HINT_PASSWORD, AUTOFILL_HINT_PHONE, AUTOFILL_HINT_POSTAL_ADDRESS, AUTOFILL_HINT_POSTAL_CODE, AUTOFILL_HINT_USERNAME, AUTOFILL_TYPE_DATE, AUTOFILL_TYPE_LIST, AUTOFILL_TYPE_NONE, AUTOFILL_TYPE_TEXT, AUTOFILL_TYPE_TOGGLE, DRAG_FLAG_GLOBAL, DRAG_FLAG_GLOBAL_PERSISTABLE_URI_PERMISSION, DRAG_FLAG_GLOBAL_PREFIX_URI_PERMISSION, DRAG_FLAG_GLOBAL_URI_READ, DRAG_FLAG_GLOBAL_URI_WRITE, DRAG_FLAG_OPAQUE, DRAWING_CACHE_QUALITY_AUTO, DRAWING_CACHE_QUALITY_HIGH, DRAWING_CACHE_QUALITY_LOW, EMPTY_STATE_SET, ENABLED_FOCUSED_SELECTED_STATE_SET, ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_FOCUSED_STATE_SET, ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, ENABLED_SELECTED_STATE_SET, ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, ENABLED_STATE_SET, ENABLED_WINDOW_FOCUSED_STATE_SET, FIND_VIEWS_WITH_CONTENT_DESCRIPTION, FIND_VIEWS_WITH_TEXT, FOCUS_BACKWARD, FOCUS_DOWN, FOCUS_FORWARD, FOCUS_LEFT, FOCUS_RIGHT, FOCUS_UP, FOCUSABLE, FOCUSABLE_AUTO, FOCUSABLES_ALL, FOCUSABLES_TOUCH_MODE, FOCUSED_SELECTED_STATE_SET, FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, FOCUSED_STATE_SET, FOCUSED_WINDOW_FOCUSED_STATE_SET, GONE, HAPTIC_FEEDBACK_ENABLED, IMPORTANT_FOR_ACCESSIBILITY_AUTO, IMPORTANT_FOR_ACCESSIBILITY_NO, IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS, IMPORTANT_FOR_ACCESSIBILITY_YES, IMPORTANT_FOR_AUTOFILL_AUTO, IMPORTANT_FOR_AUTOFILL_NO, IMPORTANT_FOR_AUTOFILL_NO_EXCLUDE_DESCENDANTS, IMPORTANT_FOR_AUTOFILL_YES, IMPORTANT_FOR_AUTOFILL_YES_EXCLUDE_DESCENDANTS, INVISIBLE, KEEP_SCREEN_ON, LAYER_TYPE_HARDWARE, LAYER_TYPE_NONE, LAYER_TYPE_SOFTWARE, LAYOUT_DIRECTION_INHERIT, LAYOUT_DIRECTION_LOCALE, LAYOUT_DIRECTION_LTR, LAYOUT_DIRECTION_RTL, MEASURED_HEIGHT_STATE_SHIFT, MEASURED_SIZE_MASK, MEASURED_STATE_MASK, MEASURED_STATE_TOO_SMALL, NO_ID, NOT_FOCUSABLE, OVER_SCROLL_ALWAYS, OVER_SCROLL_IF_CONTENT_SCROLLS, OVER_SCROLL_NEVER, PRESSED_ENABLED_FOCUSED_SELECTED_STATE_SET, PRESSED_ENABLED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_STATE_SET, PRESSED_ENABLED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_SELECTED_STATE_SET, PRESSED_ENABLED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_ENABLED_STATE_SET, PRESSED_ENABLED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_SELECTED_STATE_SET, PRESSED_FOCUSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_FOCUSED_STATE_SET, PRESSED_FOCUSED_WINDOW_FOCUSED_STATE_SET, PRESSED_SELECTED_STATE_SET, PRESSED_SELECTED_WINDOW_FOCUSED_STATE_SET, PRESSED_STATE_SET, PRESSED_WINDOW_FOCUSED_STATE_SET, ROTATION, ROTATION_X, ROTATION_Y, SCALE_X, SCALE_Y, SCREEN_STATE_OFF, SCREEN_STATE_ON, SCROLL_AXIS_HORIZONTAL, SCROLL_AXIS_NONE, SCROLL_AXIS_VERTICAL, SCROLL_INDICATOR_BOTTOM, SCROLL_INDICATOR_END, SCROLL_INDICATOR_LEFT, SCROLL_INDICATOR_RIGHT, SCROLL_INDICATOR_START, SCROLL_INDICATOR_TOP, SCROLLBAR_POSITION_DEFAULT, SCROLLBAR_POSITION_LEFT, SCROLLBAR_POSITION_RIGHT, SCROLLBARS_INSIDE_INSET, SCROLLBARS_INSIDE_OVERLAY, SCROLLBARS_OUTSIDE_INSET, SCROLLBARS_OUTSIDE_OVERLAY, SELECTED_STATE_SET, SELECTED_WINDOW_FOCUSED_STATE_SET, SOUND_EFFECTS_ENABLED, STATUS_BAR_HIDDEN, STATUS_BAR_VISIBLE, SYSTEM_UI_FLAG_FULLSCREEN, SYSTEM_UI_FLAG_HIDE_NAVIGATION, SYSTEM_UI_FLAG_IMMERSIVE, SYSTEM_UI_FLAG_IMMERSIVE_STICKY, SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN, SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION, SYSTEM_UI_FLAG_LAYOUT_STABLE, SYSTEM_UI_FLAG_LIGHT_NAVIGATION_BAR, SYSTEM_UI_FLAG_LIGHT_STATUS_BAR, SYSTEM_UI_FLAG_LOW_PROFILE, SYSTEM_UI_FLAG_VISIBLE, SYSTEM_UI_LAYOUT_FLAGS, TEXT_ALIGNMENT_CENTER, TEXT_ALIGNMENT_GRAVITY, TEXT_ALIGNMENT_INHERIT, TEXT_ALIGNMENT_TEXT_END, TEXT_ALIGNMENT_TEXT_START, TEXT_ALIGNMENT_VIEW_END, TEXT_ALIGNMENT_VIEW_START, TEXT_DIRECTION_ANY_RTL, TEXT_DIRECTION_FIRST_STRONG, TEXT_DIRECTION_FIRST_STRONG_LTR, TEXT_DIRECTION_FIRST_STRONG_RTL, TEXT_DIRECTION_INHERIT, TEXT_DIRECTION_LOCALE, TEXT_DIRECTION_LTR, TEXT_DIRECTION_RTL, TRANSLATION_X, TRANSLATION_Y, TRANSLATION_Z, VIEW_LOG_TAG, VISIBLE, WINDOW_FOCUSED_STATE_SET, X, Y, Z
    • Constructor Summary

      Constructors 
      Constructor Description
      NestedScrollView​(android.content.Context context)  
      NestedScrollView​(android.content.Context context, android.util.AttributeSet attrs)  
      NestedScrollView​(android.content.Context context, android.util.AttributeSet attrs, int defStyleAttr)
      Constructor for NestedScrollView
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addView​(android.view.View child)  
      void addView​(android.view.View child, int index)  
      void addView​(android.view.View child, int index, android.view.ViewGroup.LayoutParams params)  
      void addView​(android.view.View child, android.view.ViewGroup.LayoutParams params)  
      boolean arrowScroll​(int direction)
      Handle scrolling in response to an up or down arrow click.
      int computeHorizontalScrollExtent()  
      int computeHorizontalScrollOffset()  
      int computeHorizontalScrollRange()  
      void computeScroll()  
      protected int computeScrollDeltaToGetChildRectOnScreen​(android.graphics.Rect rect)
      Compute the amount to scroll in the Y direction in order to get a rectangle completely on the screen (or, if taller than the screen, at least the first screen size chunk of it).
      int computeVerticalScrollExtent()  
      int computeVerticalScrollOffset()  
      int computeVerticalScrollRange()
      The scroll range of a scroll view is the overall height of all of its children.
      boolean dispatchKeyEvent​(android.view.KeyEvent event)  
      boolean dispatchNestedFling​(float velocityX, float velocityY, boolean consumed)  
      boolean dispatchNestedPreFling​(float velocityX, float velocityY)  
      boolean dispatchNestedPreScroll​(int dx, int dy, int[] consumed, int[] offsetInWindow)  
      boolean dispatchNestedPreScroll​(int dx, int dy, int[] consumed, int[] offsetInWindow, int type)  
      boolean dispatchNestedScroll​(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow)  
      boolean dispatchNestedScroll​(int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed, int[] offsetInWindow, int type)  
      void draw​(android.graphics.Canvas canvas)  
      boolean executeKeyEvent​(android.view.KeyEvent event)
      You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy.
      void fling​(int velocityY)
      Fling the scroll view
      boolean fullScroll​(int direction)
      Handles scrolling in response to a "home/end" shortcut press.
      protected float getBottomFadingEdgeStrength()  
      int getMaxScrollAmount()  
      int getNestedScrollAxes()  
      protected float getTopFadingEdgeStrength()  
      boolean hasNestedScrollingParent()  
      boolean hasNestedScrollingParent​(int type)  
      boolean isFillViewport()
      Indicates whether this ScrollView's content is stretched to fill the viewport.
      boolean isNestedScrollingEnabled()  
      boolean isSmoothScrollingEnabled()  
      protected void measureChild​(android.view.View child, int parentWidthMeasureSpec, int parentHeightMeasureSpec)  
      protected void measureChildWithMargins​(android.view.View child, int parentWidthMeasureSpec, int widthUsed, int parentHeightMeasureSpec, int heightUsed)  
      void onAttachedToWindow()  
      boolean onGenericMotionEvent​(android.view.MotionEvent event)  
      boolean onInterceptTouchEvent​(android.view.MotionEvent ev)  
      protected void onLayout​(boolean changed, int l, int t, int r, int b)  
      protected void onMeasure​(int widthMeasureSpec, int heightMeasureSpec)  
      boolean onNestedFling​(android.view.View target, float velocityX, float velocityY, boolean consumed)  
      boolean onNestedPreFling​(android.view.View target, float velocityX, float velocityY)  
      void onNestedPreScroll​(android.view.View target, int dx, int dy, int[] consumed)  
      void onNestedScroll​(android.view.View target, int dxConsumed, int dyConsumed, int dxUnconsumed, int dyUnconsumed)  
      void onNestedScrollAccepted​(android.view.View child, android.view.View target, int nestedScrollAxes)  
      protected void onOverScrolled​(int scrollX, int scrollY, boolean clampedX, boolean clampedY)  
      protected boolean onRequestFocusInDescendants​(int direction, android.graphics.Rect previouslyFocusedRect)
      When looking for focus in children of a scroll view, need to be a little more careful not to give focus to something that is scrolled off screen.
      protected void onRestoreInstanceState​(android.os.Parcelable state)  
      protected android.os.Parcelable onSaveInstanceState()  
      protected void onScrollChanged​(int l, int t, int oldl, int oldt)  
      protected void onSizeChanged​(int w, int h, int oldw, int oldh)  
      boolean onStartNestedScroll​(android.view.View child, android.view.View target, int nestedScrollAxes)  
      void onStopNestedScroll​(android.view.View target)  
      boolean onTouchEvent​(android.view.MotionEvent ev)  
      boolean pageScroll​(int direction)
      Handles scrolling in response to a "page up/down" shortcut press.
      void requestChildFocus​(android.view.View child, android.view.View focused)  
      boolean requestChildRectangleOnScreen​(android.view.View child, android.graphics.Rect rectangle, boolean immediate)  
      void requestDisallowInterceptTouchEvent​(boolean disallowIntercept)  
      void requestLayout()  
      void scrollTo​(int x, int y)
      void setFillViewport​(boolean fillViewport)
      Set whether this ScrollView should stretch its content height to fill the viewport or not.
      void setNestedScrollingEnabled​(boolean enabled)  
      void setOnScrollChangeListener​(NestedScrollView.OnScrollChangeListener l)
      Register a callback to be invoked when the scroll X or Y positions of this view change.
      void setSmoothScrollingEnabled​(boolean smoothScrollingEnabled)
      Set whether arrow scrolling will animate its transition.
      boolean shouldDelayChildPressedState()  
      void smoothScrollBy​(int dx, int dy)
      Like View.scrollBy(int, int), but scroll smoothly instead of immediately.
      void smoothScrollTo​(int x, int y)
      Like scrollTo(int, int), but scroll smoothly instead of immediately.
      boolean startNestedScroll​(int axes)  
      boolean startNestedScroll​(int axes, int type)  
      void stopNestedScroll()  
      void stopNestedScroll​(int type)  
      • Methods inherited from class android.widget.FrameLayout

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

        addChildrenForAccessibility, addFocusables, addKeyboardNavigationClusters, addStatesFromChildren, addTouchables, addView, addViewInLayout, addViewInLayout, attachLayoutAnimationParameters, attachViewToParent, bringChildToFront, canAnimate, childDrawableStateChanged, childHasTransientStateChanged, cleanupLayoutState, clearChildFocus, clearDisappearingChildren, clearFocus, debug, detachAllViewsFromParent, detachViewFromParent, detachViewFromParent, detachViewsFromParent, dispatchApplyWindowInsets, dispatchCapturedPointerEvent, dispatchConfigurationChanged, dispatchDisplayHint, dispatchDragEvent, dispatchDraw, dispatchDrawableHotspotChanged, dispatchFinishTemporaryDetach, dispatchFreezeSelfOnly, dispatchGenericFocusedEvent, dispatchGenericPointerEvent, dispatchHoverEvent, dispatchKeyEventPreIme, dispatchKeyShortcutEvent, dispatchPointerCaptureChanged, dispatchProvideAutofillStructure, dispatchProvideStructure, dispatchRestoreInstanceState, dispatchSaveInstanceState, dispatchSetActivated, dispatchSetPressed, dispatchSetSelected, dispatchStartTemporaryDetach, dispatchSystemUiVisibilityChanged, dispatchThawSelfOnly, dispatchTouchEvent, dispatchTrackballEvent, dispatchUnhandledMove, dispatchVisibilityChanged, dispatchWindowFocusChanged, dispatchWindowSystemUiVisiblityChanged, dispatchWindowVisibilityChanged, drawableStateChanged, drawChild, endViewTransition, findFocus, findViewsWithText, focusableViewAvailable, focusSearch, gatherTransparentRegion, getChildAt, getChildCount, getChildDrawingOrder, getChildDrawingOrder, getChildMeasureSpec, getChildStaticTransformation, getChildVisibleRect, getClipChildren, getClipToPadding, getDescendantFocusability, getFocusedChild, getLayoutAnimation, getLayoutAnimationListener, getLayoutMode, getLayoutTransition, getOverlay, getPersistentDrawingCache, getTouchscreenBlocksFocus, hasFocus, hasTransientState, indexOfChild, invalidateChild, invalidateChildInParent, isAlwaysDrawnWithCacheEnabled, isAnimationCacheEnabled, isChildrenDrawingOrderEnabled, isChildrenDrawnWithCacheEnabled, isLayoutSuppressed, isMotionEventSplittingEnabled, isTransitionGroup, jumpDrawablesToCurrentState, layout, measureChildren, notifySubtreeAccessibilityStateChanged, offsetDescendantRectToMyCoords, offsetRectIntoDescendantCoords, onCreateDrawableState, onDescendantInvalidated, onDetachedFromWindow, onInterceptHoverEvent, onNestedPrePerformAccessibilityAction, onRequestSendAccessibilityEvent, onResolvePointerIcon, onViewAdded, onViewRemoved, recomputeViewAttributes, removeAllViews, removeAllViewsInLayout, removeDetachedView, removeView, removeViewAt, removeViewInLayout, removeViews, removeViewsInLayout, requestFocus, requestSendAccessibilityEvent, requestTransparentRegion, restoreDefaultFocus, scheduleLayoutAnimation, setAddStatesFromChildren, setAlwaysDrawnWithCacheEnabled, setAnimationCacheEnabled, setChildrenDrawingCacheEnabled, setChildrenDrawingOrderEnabled, setChildrenDrawnWithCacheEnabled, setClipChildren, setClipToPadding, setDescendantFocusability, setLayoutAnimation, setLayoutAnimationListener, setLayoutMode, setLayoutTransition, setMotionEventSplittingEnabled, setOnHierarchyChangeListener, setPersistentDrawingCache, setStaticTransformationsEnabled, setTouchscreenBlocksFocus, setTransitionGroup, showContextMenuForChild, showContextMenuForChild, startActionModeForChild, startActionModeForChild, startLayoutAnimation, startViewTransition, suppressLayout, updateViewLayout
      • Methods inherited from class android.view.View

        addExtraDataToAccessibilityNodeInfo, addFocusables, addOnAttachStateChangeListener, addOnLayoutChangeListener, addOnUnhandledKeyEventListener, animate, announceForAccessibility, autofill, autofill, awakenScrollBars, awakenScrollBars, awakenScrollBars, bringToFront, buildDrawingCache, buildDrawingCache, buildLayer, callOnClick, cancelDragAndDrop, cancelLongPress, cancelPendingInputEvents, canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, canScrollHorizontally, canScrollVertically, checkInputConnectionProxy, clearAnimation, combineMeasuredStates, computeSystemWindowInsets, createAccessibilityNodeInfo, createContextMenu, destroyDrawingCache, dispatchGenericMotionEvent, dispatchNestedPrePerformAccessibilityAction, dispatchPopulateAccessibilityEvent, drawableHotspotChanged, findViewById, findViewWithTag, fitSystemWindows, focusSearch, forceHasOverlappingRendering, forceLayout, generateViewId, getAccessibilityDelegate, getAccessibilityLiveRegion, getAccessibilityNodeProvider, getAccessibilityPaneTitle, getAccessibilityTraversalAfter, getAccessibilityTraversalBefore, getAlpha, getAnimation, getAnimationMatrix, getApplicationWindowToken, getAttributeResolutionStack, getAttributeSourceResourceMap, getAutofillHints, getAutofillId, getAutofillType, getAutofillValue, getBackground, getBackgroundTintBlendMode, getBackgroundTintList, getBackgroundTintMode, getBaseline, getBottom, getBottomPaddingOffset, getCameraDistance, getClipBounds, getClipBounds, getClipToOutline, getContentCaptureSession, getContentDescription, getContext, getContextMenuInfo, getDefaultFocusHighlightEnabled, getDefaultSize, getDisplay, getDrawableState, getDrawingCache, getDrawingCache, getDrawingCacheBackgroundColor, getDrawingCacheQuality, getDrawingRect, getDrawingTime, getElevation, getExplicitStyle, getFilterTouchesWhenObscured, getFitsSystemWindows, getFocusable, getFocusables, getFocusedRect, getForeground, getForegroundGravity, getForegroundTintBlendMode, getForegroundTintList, getForegroundTintMode, getGlobalVisibleRect, getGlobalVisibleRect, getHandler, getHasOverlappingRendering, getHeight, getHitRect, getHorizontalFadingEdgeLength, getHorizontalScrollbarHeight, getHorizontalScrollbarThumbDrawable, getHorizontalScrollbarTrackDrawable, getId, getImportantForAccessibility, getImportantForAutofill, getKeepScreenOn, getKeyDispatcherState, getLabelFor, getLayerType, getLayoutDirection, getLayoutParams, getLeft, getLeftFadingEdgeStrength, getLeftPaddingOffset, getLocalVisibleRect, getLocationInSurface, getLocationInWindow, getLocationOnScreen, getMatrix, getMeasuredHeight, getMeasuredHeightAndState, getMeasuredState, getMeasuredWidth, getMeasuredWidthAndState, getMinimumHeight, getMinimumWidth, getNextClusterForwardId, getNextFocusDownId, getNextFocusForwardId, getNextFocusLeftId, getNextFocusRightId, getNextFocusUpId, getOnFocusChangeListener, getOutlineAmbientShadowColor, getOutlineProvider, getOutlineSpotShadowColor, getOverScrollMode, getPaddingBottom, getPaddingEnd, getPaddingLeft, getPaddingRight, getPaddingStart, getPaddingTop, getParent, getParentForAccessibility, getPivotX, getPivotY, getPointerIcon, getResources, getRevealOnFocusHint, getRight, getRightFadingEdgeStrength, getRightPaddingOffset, getRootView, getRootWindowInsets, getRotation, getRotationX, getRotationY, getScaleX, getScaleY, getScrollBarDefaultDelayBeforeFade, getScrollBarFadeDuration, getScrollBarSize, getScrollBarStyle, getScrollIndicators, getScrollX, getScrollY, getSolidColor, getSourceLayoutResId, getStateListAnimator, getSuggestedMinimumHeight, getSuggestedMinimumWidth, getSystemGestureExclusionRects, getSystemUiVisibility, getTag, getTag, getTextAlignment, getTextDirection, getTooltipText, getTop, getTopPaddingOffset, getTouchables, getTouchDelegate, getTransitionAlpha, getTransitionName, getTranslationX, getTranslationY, getTranslationZ, getUniqueDrawingId, getVerticalFadingEdgeLength, getVerticalScrollbarPosition, getVerticalScrollbarThumbDrawable, getVerticalScrollbarTrackDrawable, getVerticalScrollbarWidth, getViewTreeObserver, getVisibility, getWidth, getWindowAttachCount, getWindowId, getWindowSystemUiVisibility, getWindowToken, getWindowVisibility, getWindowVisibleDisplayFrame, getX, getY, getZ, hasExplicitFocusable, hasFocusable, hasOnClickListeners, hasOverlappingRendering, hasPointerCapture, hasWindowFocus, inflate, invalidate, invalidate, 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, isInEditMode, isInLayout, isInTouchMode, isKeyboardNavigationCluster, isLaidOut, isLayoutDirectionResolved, isLayoutRequested, isLongClickable, isOpaque, isPaddingOffsetRequired, isPaddingRelative, isPivotSet, isPressed, isSaveEnabled, isSaveFromParentEnabled, isScreenReaderFocusable, isScrollbarFadingEnabled, isScrollContainer, isSelected, isShown, isSoundEffectsEnabled, isTemporarilyDetached, isTextAlignmentResolved, isTextDirectionResolved, isVerticalFadingEdgeEnabled, isVerticalScrollBarEnabled, isVisibleToUserForAutofill, keyboardNavigationClusterSearch, measure, mergeDrawableStates, offsetLeftAndRight, offsetTopAndBottom, onAnimationEnd, onAnimationStart, onApplyWindowInsets, onCancelPendingInputEvents, onCapturedPointerEvent, onCheckIsTextEditor, onConfigurationChanged, onCreateContextMenu, onCreateInputConnection, onDisplayHint, onDragEvent, onDraw, onDrawForeground, onDrawScrollBars, onFilterTouchEventForSecurity, onFinishInflate, onFinishTemporaryDetach, onFocusChanged, onHoverChanged, onHoverEvent, onInitializeAccessibilityEvent, onInitializeAccessibilityNodeInfo, onKeyDown, onKeyLongPress, onKeyMultiple, onKeyPreIme, onKeyShortcut, onKeyUp, onPointerCaptureChange, onPopulateAccessibilityEvent, onProvideAutofillStructure, onProvideAutofillVirtualStructure, onProvideStructure, onProvideVirtualStructure, onRtlPropertiesChanged, onScreenStateChanged, onSetAlpha, onStartTemporaryDetach, onTrackballEvent, onVisibilityAggregated, onVisibilityChanged, onWindowFocusChanged, onWindowSystemUiVisibilityChanged, onWindowVisibilityChanged, overScrollBy, performAccessibilityAction, performClick, performContextClick, performContextClick, performHapticFeedback, performHapticFeedback, performLongClick, performLongClick, playSoundEffect, post, postDelayed, postInvalidate, postInvalidate, postInvalidateDelayed, postInvalidateDelayed, postInvalidateOnAnimation, postInvalidateOnAnimation, postOnAnimation, postOnAnimationDelayed, refreshDrawableState, releasePointerCapture, removeCallbacks, removeOnAttachStateChangeListener, removeOnLayoutChangeListener, removeOnUnhandledKeyEventListener, requestApplyInsets, requestFitSystemWindows, requestFocus, requestFocus, requestFocusFromTouch, requestPointerCapture, requestRectangleOnScreen, requestRectangleOnScreen, requestUnbufferedDispatch, requireViewById, resetPivot, resolveSize, resolveSizeAndState, restoreHierarchyState, saveAttributeDataForStyleable, saveHierarchyState, scheduleDrawable, scrollBy, sendAccessibilityEvent, sendAccessibilityEventUnchecked, setAccessibilityDelegate, setAccessibilityHeading, setAccessibilityLiveRegion, setAccessibilityPaneTitle, setAccessibilityTraversalAfter, setAccessibilityTraversalBefore, setActivated, 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, setFocusable, setFocusableInTouchMode, setFocusedByDefault, setForceDarkAllowed, setForeground, setForegroundTintBlendMode, setForegroundTintList, setForegroundTintMode, setHapticFeedbackEnabled, setHasTransientState, setHorizontalFadingEdgeEnabled, setHorizontalScrollBarEnabled, setHorizontalScrollbarThumbDrawable, setHorizontalScrollbarTrackDrawable, setHovered, setId, setImportantForAccessibility, setImportantForAutofill, setKeepScreenOn, setKeyboardNavigationCluster, setLabelFor, setLayerPaint, setLayerType, setLayoutDirection, setLayoutParams, setLeft, setLeftTopRightBottom, setLongClickable, setMeasuredDimension, setMinimumHeight, setMinimumWidth, setNextClusterForwardId, setNextFocusDownId, setNextFocusForwardId, setNextFocusLeftId, setNextFocusRightId, setNextFocusUpId, setOnApplyWindowInsetsListener, setOnCapturedPointerListener, setOnClickListener, setOnContextClickListener, setOnCreateContextMenuListener, setOnDragListener, setOnFocusChangeListener, setOnGenericMotionListener, setOnHoverListener, setOnKeyListener, setOnLongClickListener, setOnScrollChangeListener, setOnSystemUiVisibilityChangeListener, setOnTouchListener, setOutlineAmbientShadowColor, setOutlineProvider, setOutlineSpotShadowColor, setOverScrollMode, setPadding, setPaddingRelative, setPivotX, setPivotY, setPointerIcon, setPressed, setRevealOnFocusHint, setRight, setRotation, setRotationX, setRotationY, setSaveEnabled, setSaveFromParentEnabled, setScaleX, setScaleY, setScreenReaderFocusable, setScrollBarDefaultDelayBeforeFade, setScrollBarFadeDuration, setScrollbarFadingEnabled, setScrollBarSize, setScrollBarStyle, setScrollContainer, setScrollIndicators, setScrollIndicators, setScrollX, setScrollY, setSelected, setSoundEffectsEnabled, setStateListAnimator, setSystemGestureExclusionRects, setSystemUiVisibility, setTag, setTag, setTextAlignment, setTextDirection, setTooltipText, setTop, setTouchDelegate, setTransitionAlpha, setTransitionName, setTransitionVisibility, setTranslationX, setTranslationY, setTranslationZ, setVerticalFadingEdgeEnabled, setVerticalScrollBarEnabled, setVerticalScrollbarPosition, setVerticalScrollbarThumbDrawable, setVerticalScrollbarTrackDrawable, setVisibility, setWillNotCacheDrawing, setWillNotDraw, setX, setY, setZ, showContextMenu, showContextMenu, startActionMode, startActionMode, startAnimation, startDrag, startDragAndDrop, toString, transformMatrixToGlobal, transformMatrixToLocal, unscheduleDrawable, unscheduleDrawable, updateDragShadow, verifyDrawable, willNotCacheDrawing, willNotDraw
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface android.view.ViewParent

        canResolveLayoutDirection, canResolveTextAlignment, canResolveTextDirection, createContextMenu, getLayoutDirection, getParent, getParentForAccessibility, getTextAlignment, getTextDirection, isLayoutDirectionResolved, isLayoutRequested, isTextAlignmentResolved, isTextDirectionResolved, keyboardNavigationClusterSearch, requestFitSystemWindows
    • Constructor Detail

      • NestedScrollView

        public NestedScrollView​(android.content.Context context)
      • NestedScrollView

        public NestedScrollView​(android.content.Context context,
                                android.util.AttributeSet attrs)
      • NestedScrollView

        public NestedScrollView​(android.content.Context context,
                                android.util.AttributeSet attrs,
                                int defStyleAttr)
        Constructor for NestedScrollView
        Parameters:
        context - context of the application
        attrs - set of properties
        defStyleAttr - default style attribute
    • Method Detail

      • setNestedScrollingEnabled

        public void setNestedScrollingEnabled​(boolean enabled)
        Specified by:
        setNestedScrollingEnabled in interface androidx.core.view.NestedScrollingChild
        Overrides:
        setNestedScrollingEnabled in class android.view.View
      • isNestedScrollingEnabled

        public boolean isNestedScrollingEnabled()
        Specified by:
        isNestedScrollingEnabled in interface androidx.core.view.NestedScrollingChild
        Overrides:
        isNestedScrollingEnabled in class android.view.View
      • startNestedScroll

        public boolean startNestedScroll​(int axes)
        Specified by:
        startNestedScroll in interface androidx.core.view.NestedScrollingChild
        Overrides:
        startNestedScroll in class android.view.View
      • startNestedScroll

        public boolean startNestedScroll​(int axes,
                                         int type)
        Specified by:
        startNestedScroll in interface androidx.core.view.NestedScrollingChild2
      • stopNestedScroll

        public void stopNestedScroll()
        Specified by:
        stopNestedScroll in interface androidx.core.view.NestedScrollingChild
        Overrides:
        stopNestedScroll in class android.view.View
      • stopNestedScroll

        public void stopNestedScroll​(int type)
        Specified by:
        stopNestedScroll in interface androidx.core.view.NestedScrollingChild2
      • hasNestedScrollingParent

        public boolean hasNestedScrollingParent()
        Specified by:
        hasNestedScrollingParent in interface androidx.core.view.NestedScrollingChild
        Overrides:
        hasNestedScrollingParent in class android.view.View
      • hasNestedScrollingParent

        public boolean hasNestedScrollingParent​(int type)
        Specified by:
        hasNestedScrollingParent in interface androidx.core.view.NestedScrollingChild2
      • dispatchNestedScroll

        public boolean dispatchNestedScroll​(int dxConsumed,
                                            int dyConsumed,
                                            int dxUnconsumed,
                                            int dyUnconsumed,
                                            int[] offsetInWindow)
        Specified by:
        dispatchNestedScroll in interface androidx.core.view.NestedScrollingChild
        Overrides:
        dispatchNestedScroll in class android.view.View
      • dispatchNestedScroll

        public boolean dispatchNestedScroll​(int dxConsumed,
                                            int dyConsumed,
                                            int dxUnconsumed,
                                            int dyUnconsumed,
                                            int[] offsetInWindow,
                                            int type)
        Specified by:
        dispatchNestedScroll in interface androidx.core.view.NestedScrollingChild2
      • dispatchNestedPreScroll

        public boolean dispatchNestedPreScroll​(int dx,
                                               int dy,
                                               int[] consumed,
                                               int[] offsetInWindow)
        Specified by:
        dispatchNestedPreScroll in interface androidx.core.view.NestedScrollingChild
        Overrides:
        dispatchNestedPreScroll in class android.view.View
      • dispatchNestedPreScroll

        public boolean dispatchNestedPreScroll​(int dx,
                                               int dy,
                                               int[] consumed,
                                               int[] offsetInWindow,
                                               int type)
        Specified by:
        dispatchNestedPreScroll in interface androidx.core.view.NestedScrollingChild2
      • dispatchNestedFling

        public boolean dispatchNestedFling​(float velocityX,
                                           float velocityY,
                                           boolean consumed)
        Specified by:
        dispatchNestedFling in interface androidx.core.view.NestedScrollingChild
        Overrides:
        dispatchNestedFling in class android.view.View
      • dispatchNestedPreFling

        public boolean dispatchNestedPreFling​(float velocityX,
                                              float velocityY)
        Specified by:
        dispatchNestedPreFling in interface androidx.core.view.NestedScrollingChild
        Overrides:
        dispatchNestedPreFling in class android.view.View
      • onStartNestedScroll

        public boolean onStartNestedScroll​(android.view.View child,
                                           android.view.View target,
                                           int nestedScrollAxes)
        Specified by:
        onStartNestedScroll in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onStartNestedScroll in interface android.view.ViewParent
        Overrides:
        onStartNestedScroll in class android.view.ViewGroup
      • onNestedScrollAccepted

        public void onNestedScrollAccepted​(android.view.View child,
                                           android.view.View target,
                                           int nestedScrollAxes)
        Specified by:
        onNestedScrollAccepted in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onNestedScrollAccepted in interface android.view.ViewParent
        Overrides:
        onNestedScrollAccepted in class android.view.ViewGroup
      • onStopNestedScroll

        public void onStopNestedScroll​(android.view.View target)
        Specified by:
        onStopNestedScroll in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onStopNestedScroll in interface android.view.ViewParent
        Overrides:
        onStopNestedScroll in class android.view.ViewGroup
      • onNestedScroll

        public void onNestedScroll​(android.view.View target,
                                   int dxConsumed,
                                   int dyConsumed,
                                   int dxUnconsumed,
                                   int dyUnconsumed)
        Specified by:
        onNestedScroll in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onNestedScroll in interface android.view.ViewParent
        Overrides:
        onNestedScroll in class android.view.ViewGroup
      • onNestedPreScroll

        public void onNestedPreScroll​(android.view.View target,
                                      int dx,
                                      int dy,
                                      int[] consumed)
        Specified by:
        onNestedPreScroll in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onNestedPreScroll in interface android.view.ViewParent
        Overrides:
        onNestedPreScroll in class android.view.ViewGroup
      • onNestedFling

        public boolean onNestedFling​(android.view.View target,
                                     float velocityX,
                                     float velocityY,
                                     boolean consumed)
        Specified by:
        onNestedFling in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onNestedFling in interface android.view.ViewParent
        Overrides:
        onNestedFling in class android.view.ViewGroup
      • onNestedPreFling

        public boolean onNestedPreFling​(android.view.View target,
                                        float velocityX,
                                        float velocityY)
        Specified by:
        onNestedPreFling in interface androidx.core.view.NestedScrollingParent
        Specified by:
        onNestedPreFling in interface android.view.ViewParent
        Overrides:
        onNestedPreFling in class android.view.ViewGroup
      • getNestedScrollAxes

        public int getNestedScrollAxes()
        Specified by:
        getNestedScrollAxes in interface androidx.core.view.NestedScrollingParent
        Overrides:
        getNestedScrollAxes in class android.view.ViewGroup
      • shouldDelayChildPressedState

        public boolean shouldDelayChildPressedState()
        Overrides:
        shouldDelayChildPressedState in class android.widget.FrameLayout
      • getTopFadingEdgeStrength

        protected float getTopFadingEdgeStrength()
        Overrides:
        getTopFadingEdgeStrength in class android.view.View
      • getBottomFadingEdgeStrength

        protected float getBottomFadingEdgeStrength()
        Overrides:
        getBottomFadingEdgeStrength in class android.view.View
      • getMaxScrollAmount

        public int getMaxScrollAmount()
        Returns:
        The maximum amount this scroll view will scroll in response to an arrow event.
      • addView

        public void addView​(android.view.View child)
        Overrides:
        addView in class android.view.ViewGroup
      • addView

        public void addView​(android.view.View child,
                            int index)
        Overrides:
        addView in class android.view.ViewGroup
      • addView

        public void addView​(android.view.View child,
                            android.view.ViewGroup.LayoutParams params)
        Specified by:
        addView in interface android.view.ViewManager
        Overrides:
        addView in class android.view.ViewGroup
      • addView

        public void addView​(android.view.View child,
                            int index,
                            android.view.ViewGroup.LayoutParams params)
        Overrides:
        addView in class android.view.ViewGroup
      • setOnScrollChangeListener

        public void setOnScrollChangeListener​(NestedScrollView.OnScrollChangeListener l)
        Register a callback to be invoked when the scroll X or Y positions of this view change.

        This version of the method works on all versions of Android, back to API v4.

        Parameters:
        l - The listener to notify when the scroll X or Y position changes.
        See Also:
        View.getScrollX(), View.getScrollY()
      • isFillViewport

        public boolean isFillViewport()
        Indicates whether this ScrollView's content is stretched to fill the viewport.
        Returns:
        true if the content fills the viewport, false otherwise.
      • setFillViewport

        public void setFillViewport​(boolean fillViewport)
        Set whether this ScrollView should stretch its content height to fill the viewport or not.
        Parameters:
        fillViewport - True to stretch the content's height to the viewport's boundaries, false otherwise.
      • isSmoothScrollingEnabled

        public boolean isSmoothScrollingEnabled()
        Returns:
        Whether arrow scrolling will animate its transition.
      • setSmoothScrollingEnabled

        public void setSmoothScrollingEnabled​(boolean smoothScrollingEnabled)
        Set whether arrow scrolling will animate its transition.
        Parameters:
        smoothScrollingEnabled - whether arrow scrolling will animate its transition
      • onScrollChanged

        protected void onScrollChanged​(int l,
                                       int t,
                                       int oldl,
                                       int oldt)
        Overrides:
        onScrollChanged in class android.view.View
      • onMeasure

        protected void onMeasure​(int widthMeasureSpec,
                                 int heightMeasureSpec)
        Overrides:
        onMeasure in class android.widget.FrameLayout
      • dispatchKeyEvent

        public boolean dispatchKeyEvent​(android.view.KeyEvent event)
        Overrides:
        dispatchKeyEvent in class android.view.ViewGroup
      • executeKeyEvent

        public boolean executeKeyEvent​(android.view.KeyEvent event)
        You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy.
        Parameters:
        event - The key event to execute.
        Returns:
        Return true if the event was handled, else false.
      • requestDisallowInterceptTouchEvent

        public void requestDisallowInterceptTouchEvent​(boolean disallowIntercept)
        Specified by:
        requestDisallowInterceptTouchEvent in interface android.view.ViewParent
        Overrides:
        requestDisallowInterceptTouchEvent in class android.view.ViewGroup
      • onInterceptTouchEvent

        public boolean onInterceptTouchEvent​(android.view.MotionEvent ev)
        Overrides:
        onInterceptTouchEvent in class android.view.ViewGroup
      • onTouchEvent

        public boolean onTouchEvent​(android.view.MotionEvent ev)
        Overrides:
        onTouchEvent in class android.view.View
      • onGenericMotionEvent

        public boolean onGenericMotionEvent​(android.view.MotionEvent event)
        Overrides:
        onGenericMotionEvent in class android.view.View
      • onOverScrolled

        protected void onOverScrolled​(int scrollX,
                                      int scrollY,
                                      boolean clampedX,
                                      boolean clampedY)
        Overrides:
        onOverScrolled in class android.view.View
      • pageScroll

        public boolean pageScroll​(int direction)

        Handles scrolling in response to a "page up/down" shortcut press. This method will scroll the view by one page up or down and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollview reclaims the focus.

        Parameters:
        direction - the scroll direction: View.FOCUS_UP to go one page up or View.FOCUS_DOWN to go one page down
        Returns:
        true if the key event is consumed by this method, false otherwise
      • fullScroll

        public boolean fullScroll​(int direction)

        Handles scrolling in response to a "home/end" shortcut press. This method will scroll the view to the top or bottom and give the focus to the topmost/bottommost component in the new visible area. If no component is a good candidate for focus, this scrollview reclaims the focus.

        Parameters:
        direction - the scroll direction: View.FOCUS_UP to go the top of the view or View.FOCUS_DOWN to go the bottom
        Returns:
        true if the key event is consumed by this method, false otherwise
      • arrowScroll

        public boolean arrowScroll​(int direction)
        Handle scrolling in response to an up or down arrow click.
        Parameters:
        direction - The direction corresponding to the arrow key that was pressed
        Returns:
        True if we consumed the event, false otherwise
      • smoothScrollBy

        public final void smoothScrollBy​(int dx,
                                         int dy)
        Like View.scrollBy(int, int), but scroll smoothly instead of immediately.
        Parameters:
        dx - the number of pixels to scroll by on the X axis
        dy - the number of pixels to scroll by on the Y axis
      • smoothScrollTo

        public final void smoothScrollTo​(int x,
                                         int y)
        Like scrollTo(int, int), but scroll smoothly instead of immediately.
        Parameters:
        x - the position where to scroll on the X axis
        y - the position where to scroll on the Y axis
      • computeVerticalScrollRange

        public int computeVerticalScrollRange()

        The scroll range of a scroll view is the overall height of all of its children.

        Specified by:
        computeVerticalScrollRange in interface androidx.core.view.ScrollingView
        Overrides:
        computeVerticalScrollRange in class android.view.View
      • computeVerticalScrollOffset

        public int computeVerticalScrollOffset()
        Specified by:
        computeVerticalScrollOffset in interface androidx.core.view.ScrollingView
        Overrides:
        computeVerticalScrollOffset in class android.view.View
      • computeVerticalScrollExtent

        public int computeVerticalScrollExtent()
        Specified by:
        computeVerticalScrollExtent in interface androidx.core.view.ScrollingView
        Overrides:
        computeVerticalScrollExtent in class android.view.View
      • computeHorizontalScrollRange

        public int computeHorizontalScrollRange()
        Specified by:
        computeHorizontalScrollRange in interface androidx.core.view.ScrollingView
        Overrides:
        computeHorizontalScrollRange in class android.view.View
      • computeHorizontalScrollOffset

        public int computeHorizontalScrollOffset()
        Specified by:
        computeHorizontalScrollOffset in interface androidx.core.view.ScrollingView
        Overrides:
        computeHorizontalScrollOffset in class android.view.View
      • computeHorizontalScrollExtent

        public int computeHorizontalScrollExtent()
        Specified by:
        computeHorizontalScrollExtent in interface androidx.core.view.ScrollingView
        Overrides:
        computeHorizontalScrollExtent in class android.view.View
      • measureChild

        protected void measureChild​(android.view.View child,
                                    int parentWidthMeasureSpec,
                                    int parentHeightMeasureSpec)
        Overrides:
        measureChild in class android.view.ViewGroup
      • measureChildWithMargins

        protected void measureChildWithMargins​(android.view.View child,
                                               int parentWidthMeasureSpec,
                                               int widthUsed,
                                               int parentHeightMeasureSpec,
                                               int heightUsed)
        Overrides:
        measureChildWithMargins in class android.view.ViewGroup
      • computeScroll

        public void computeScroll()
        Overrides:
        computeScroll in class android.view.View
      • computeScrollDeltaToGetChildRectOnScreen

        protected int computeScrollDeltaToGetChildRectOnScreen​(android.graphics.Rect rect)
        Compute the amount to scroll in the Y direction in order to get a rectangle completely on the screen (or, if taller than the screen, at least the first screen size chunk of it).
        Parameters:
        rect - The rect.
        Returns:
        The scroll delta.
      • requestChildFocus

        public void requestChildFocus​(android.view.View child,
                                      android.view.View focused)
        Specified by:
        requestChildFocus in interface android.view.ViewParent
        Overrides:
        requestChildFocus in class android.view.ViewGroup
      • onRequestFocusInDescendants

        protected boolean onRequestFocusInDescendants​(int direction,
                                                      android.graphics.Rect previouslyFocusedRect)
        When looking for focus in children of a scroll view, need to be a little more careful not to give focus to something that is scrolled off screen.

        This is more expensive than the default ViewGroup implementation, otherwise this behavior might have been made the default.

        Overrides:
        onRequestFocusInDescendants in class android.view.ViewGroup
      • requestChildRectangleOnScreen

        public boolean requestChildRectangleOnScreen​(android.view.View child,
                                                     android.graphics.Rect rectangle,
                                                     boolean immediate)
        Specified by:
        requestChildRectangleOnScreen in interface android.view.ViewParent
        Overrides:
        requestChildRectangleOnScreen in class android.view.ViewGroup
      • requestLayout

        public void requestLayout()
        Specified by:
        requestLayout in interface android.view.ViewParent
        Overrides:
        requestLayout in class android.view.View
      • onLayout

        protected void onLayout​(boolean changed,
                                int l,
                                int t,
                                int r,
                                int b)
        Overrides:
        onLayout in class android.widget.FrameLayout
      • onAttachedToWindow

        public void onAttachedToWindow()
        Overrides:
        onAttachedToWindow in class android.view.ViewGroup
      • onSizeChanged

        protected void onSizeChanged​(int w,
                                     int h,
                                     int oldw,
                                     int oldh)
        Overrides:
        onSizeChanged in class android.view.View
      • fling

        public void fling​(int velocityY)
        Fling the scroll view
        Parameters:
        velocityY - The initial velocity in the Y direction. Positive numbers mean that the finger/cursor is moving down the screen, which means we want to scroll towards the top.
      • scrollTo

        public void scrollTo​(int x,
                             int y)

        This version also clamps the scrolling to the bounds of our child.

        Overrides:
        scrollTo in class android.view.View
      • draw

        public void draw​(android.graphics.Canvas canvas)
        Overrides:
        draw in class android.view.View
      • onRestoreInstanceState

        protected void onRestoreInstanceState​(android.os.Parcelable state)
        Overrides:
        onRestoreInstanceState in class android.view.View
      • onSaveInstanceState

        protected android.os.Parcelable onSaveInstanceState()
        Overrides:
        onSaveInstanceState in class android.view.View