NestedScrollView
open class NestedScrollView : FrameLayout, NestedScrollingParent3, NestedScrollingChild3, ScrollingView, SeslScrollable
(SESL Modified) 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.
Samsung Extension Software Library (SESL) Features:
- Floating GoToTop Button: Enable via seslSetGoToTopEnabled to display an interactive floating "go to top" button during scrolling. Supports custom click callbacks (SeslOnGoToTopClickListener), One UI dynamic blur backgrounds (seslSetGoToTopBlurEnabled), S-Pen stylus hover gestures, and custom bottom padding/suppression.
- AGSL Shader Fading Edges: Enable high-quality AGSL runtime shader fading edges at the scroll boundaries using seslSetFadingEdgeEnabled. Supports custom top/bottom heights, cubic-bezier easing interpolator slot overrides (SeslTopFadingEdgeOverrides, SeslBottomFadingEdgeOverrides), color customization, and window bottom alignment.
- Hover Scrolling: Automatically scrolls content when an S-Pen or mouse pointer hovers near the top or bottom edges (seslSetHoverScrollEnabled). Hover trigger area padding and AppBar coordination can be configured via seslSetHoverTopPadding and seslSetBottomHoverScrollWithAppBar.
- Custom Scrollbar &Padding Styling: Configurable horizontal padding background fill (seslSetFillHorizontalPaddingEnabled) and custom vertical scrollbar offsets.
- SeslScrollable Interface: Implements SeslScrollable to expose a standardized contract for GoToTop, fading edge, and bounds coordination across SESL scrollable components.
Constructors
Link copied to clipboard
constructor(@NonNull context: @NonNull Context, @Nullable attrs: @Nullable AttributeSet, defStyleAttr: Int)
Types
Link copied to clipboard
interface OnScrollChangeListener
Interface definition for a callback to be invoked when the scroll X or Y positions of a view change.
Link copied to clipboard
interface SeslOnGoToTopClickListener
Interface definition for a callback to be invoked when the GoToTop button is clicked.
Functions
Link copied to clipboard
open fun addOnScrollChangeListener(@NonNull listener: @NonNull NestedScrollView.OnScrollChangeListener)
Link copied to clipboard
Handle scrolling in response to an up or down arrow click.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
The scroll range of a scroll view is the overall height of all of its children.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun dispatchNestedPreScroll(dx: Int, dy: Int, consumed: @Nullable Array<Int>, offsetInWindow: @Nullable Array<Int>): Boolean
open fun dispatchNestedPreScroll(dx: Int, dy: Int, consumed: @Nullable Array<Int>, offsetInWindow: @Nullable Array<Int>, type: Int): Boolean
Dispatch one step of a nested scroll in progress before this view consumes any portion of it.
Link copied to clipboard
open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>): Boolean
open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>, type: Int): Boolean
open fun dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: @Nullable Array<Int>, type: Int, consumed: @NonNull Array<Int>)
Dispatch one step of a nested scroll in progress.
Link copied to clipboard
Link copied to clipboard
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.
Link copied to clipboard
Handles scrolling in response to a "home/end" shortcut press.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Returns true if this view has a nested scrolling parent for the given input type.
Link copied to clipboard
Indicates whether this ScrollView's content is stretched to fill the viewport.
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open fun onNestedPreFling(@NonNull target: @NonNull View, velocityX: Float, velocityY: Float): Boolean
Link copied to clipboard
open fun onNestedPreScroll(@NonNull target: @NonNull View, dx: Int, dy: Int, consumed: @NonNull Array<Int>)
open fun onNestedPreScroll(@NonNull target: @NonNull View, dx: Int, dy: Int, consumed: @NonNull Array<Int>, type: Int)
React to a nested scroll in progress before the target view consumes a portion of the scroll.
Link copied to clipboard
open fun onNestedScroll(@NonNull target: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int)
open fun onNestedScroll(@NonNull target: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int)
open fun onNestedScroll(@NonNull target: @NonNull View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, type: Int, consumed: @NonNull Array<Int>)
React to a nested scroll in progress.
Link copied to clipboard
open fun onNestedScrollAccepted(@NonNull child: @NonNull View, @NonNull target: @NonNull View, axes: Int)
open fun onNestedScrollAccepted(@NonNull child: @NonNull View, @NonNull target: @NonNull View, axes: Int, type: Int)
React to the successful claiming of a nested scroll operation.
Link copied to clipboard
open fun onStartNestedScroll(@NonNull child: @NonNull View, @NonNull target: @NonNull View, axes: Int): Boolean
open fun onStartNestedScroll(@NonNull child: @NonNull View, @NonNull target: @NonNull View, axes: Int, type: Int): Boolean
React to a descendant view initiating a nestable scroll operation, claiming the nested scroll operation if appropriate.
Link copied to clipboard
React to a nested scroll operation ending.
Link copied to clipboard
Link copied to clipboard
Handles scrolling in response to a "page up/down" shortcut press.
Link copied to clipboard
open fun removeOnScrollChangeListener(@NonNull listener: @NonNull NestedScrollView.OnScrollChangeListener)
Link copied to clipboard
Link copied to clipboard
open fun requestChildRectangleOnScreen(@NonNull child: @NonNull View, rectangle: Rect, immediate: Boolean): Boolean
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Clears bottom fading edge height and interpolator overrides.
Link copied to clipboard
Clears top fading edge height and interpolator overrides.
Link copied to clipboard
Forces the bottom fading edge height to a clamped value.
Link copied to clipboard
Forces the top fading edge height to a clamped value.
Link copied to clipboard
Returns available drawing bounds for the widget.
Link copied to clipboard
Returns bottom scroll offset for fading edges in pixels.
Link copied to clipboard
Returns current bottom padding applied to the GoToTop button position.
Link copied to clipboard
Returns default bottom padding applied to the GoToTop button position.
Link copied to clipboard
Returns bottom padding height in pixels for hover scroll trigger area.
Link copied to clipboard
Returns top padding height in pixels for hover scroll trigger area.
Link copied to clipboard
Hides or shows the bottom fading edge.
Link copied to clipboard
Hides the GoToTop button.
Link copied to clipboard
Hides or shows the top fading edge.
Link copied to clipboard
Returns whether fading edge rendering is currently enabled.
Link copied to clipboard
Sets whether top fading edge is allowed without edge-to-edge mode.
Link copied to clipboard
Sets available drawing bounds for the widget.
Sets available drawing bounds for the widget with an optional dispatchFakeScroll flag.
Link copied to clipboard
open fun seslSetBottomFadingEdgeOverrides(@Nullable overrides: @Nullable SeslBottomFadingEdgeOverrides)
Sets bottom fading edge height and interpolator overrides.
Link copied to clipboard
Sets whether bottom hover scrolling coordinates with an AppBarLayout.
Link copied to clipboard
Sets vertical offset for the bottom scroll boundary.
Link copied to clipboard
Sets the color for fading edge rendering.
Link copied to clipboard
Enables or disables AGSL fading edge effect.
Enables or disables fading edge effect, optionally extending bottom edge.
Enables or disables fading edge effect, optionally extending top and bottom edges.
Enables or disables fading edge effect with specific top and bottom heights in pixels.
Link copied to clipboard
Sets whether bottom fading edge aligns to the window bottom.
Link copied to clipboard
Enables or disables filling horizontal padding background with specified color.
Link copied to clipboard
Sets whether legacy transfer mode should be forced for fading edges.
Link copied to clipboard
Enables or disables blur background on the GoToTop button.
Link copied to clipboard
Sets bottom padding for positioning the GoToTop button.
Link copied to clipboard
Enables or disables the floating GoToTop button using default theme light check.
Enables or disables the floating GoToTop button.
Link copied to clipboard
Sets whether GoToTop button display is suppressed.
Link copied to clipboard
Sets bottom padding height in pixels for hover scroll trigger area.
Link copied to clipboard
Enables or disables hover scrolling when an S-Pen or mouse pointer hovers near the top or bottom edges.
Link copied to clipboard
Sets top padding height in pixels for hover scroll trigger area.
Link copied to clipboard
open fun seslSetOnGoToTopClickListener(@Nullable seslOnGoToTopClickListener: @Nullable NestedScrollView.SeslOnGoToTopClickListener)
Sets listener for GoToTop button click events.
Link copied to clipboard
Sets bottom offset for vertical scrollbar positioning.
Link copied to clipboard
Sets top offset for vertical scrollbar positioning.
Link copied to clipboard
Sets top and bottom vertical padding for the scrollbar.
Link copied to clipboard
Sets top fading edge height and interpolator overrides.
Link copied to clipboard
Shows the GoToTop button.
Link copied to clipboard
Smoothly scrolls to target coordinates while dispatching nested scroll events.
Link copied to clipboard
Updates blur effect on the GoToTop button.
Link copied to clipboard
Set whether this ScrollView should stretch its content height to fill the viewport or not.
Link copied to clipboard
Link copied to clipboard
Register a callback to be invoked when the scroll X or Y positions of this view change.
Link copied to clipboard
Set whether arrow scrolling will animate its transition.
Link copied to clipboard
Link copied to clipboard
Like scrollBy, but scroll smoothly instead of immediately.
Link copied to clipboard
Like scrollTo, but scroll smoothly instead of immediately.
Link copied to clipboard
Begin a nestable scroll operation along the given axes, for the given input type.
Link copied to clipboard
Stop a nested scroll in progress for the given input type.