Google is committed to advancing racial equity for Black communities. See how.

NestedScrollView

open class NestedScrollView : FrameLayout, NestedScrollingParent3, NestedScrollingChild3, ScrollingView
kotlin.Any
   ↳ android.view.View
   ↳ android.view.ViewGroup
   ↳ android.widget.FrameLayout
   ↳ androidx.core.widget.NestedScrollView

NestedScrollView is just like android.widget.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.

Summary

Nested classes
abstract

Interface definition for a callback to be invoked when the scroll X or Y positions of a view change.

Public constructors
<init>(@NonNull context: Context)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?)

<init>(@NonNull context: Context, @Nullable attrs: AttributeSet?, defStyleAttr: Int)

Public methods
open Unit
addView(child: View!)

open Unit
addView(child: View!, index: Int)

open Unit
addView(child: View!, params: LayoutParams!)

open Unit
addView(child: View!, index: Int, params: LayoutParams!)

open Boolean
arrowScroll(direction: Int)

Handle scrolling in response to an up or down arrow click.

open Unit

open Boolean

open Boolean
dispatchNestedFling(velocityX: Float, velocityY: Float, consumed: Boolean)

open Boolean
dispatchNestedPreFling(velocityX: Float, velocityY: Float)

open Boolean
dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?, type: Int)

open Boolean
dispatchNestedPreScroll(dx: Int, dy: Int, consumed: IntArray?, offsetInWindow: IntArray?)

open Unit
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, @Nullable offsetInWindow: IntArray?, type: Int, @NonNull consumed: IntArray)

open Boolean
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: IntArray?, type: Int)

open Boolean
dispatchNestedScroll(dxConsumed: Int, dyConsumed: Int, dxUnconsumed: Int, dyUnconsumed: Int, offsetInWindow: IntArray?)

open Unit
draw(canvas: Canvas!)

open Boolean
executeKeyEvent(@NonNull event: KeyEvent)

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.

open Unit
fling(velocityY: Int)

Fling the scroll view

open Boolean
fullScroll(direction: Int)

Handles scrolling in response to a "home/end" shortcut press.

open Int

open Int

open Boolean

open Boolean

open Boolean

Indicates whether this ScrollView's content is stretched to fill the viewport.

open Boolean

open Boolean

open Unit

open Boolean

open Boolean

open Boolean
onNestedFling(@NonNull target: View, velocityX: Float, velocityY: Float, consumed: Boolean)

open Boolean
onNestedPreFling(@NonNull target: View, velocityX: Float, velocityY: Float)

open Unit
onNestedPreScroll(@NonNull target: View, dx: Int, dy: Int, @NonNull consumed: IntArray, type: Int)

open Unit
onNestedPreScroll(@NonNull target: View, dx: Int, dy: Int, @NonNull consumed: IntArray)

open Unit
onNestedScroll(@NonNull target: View, dxConsumed: Int, dyConsumed: Int, dxUnconsumed