Function

animateScrollBy

Scroll by value pixels with animation.

animateScrollBy

Source set: Common
public suspend fun ScrollableState.animateScrollBy(
    value: Float,
    animationSpec: AnimationSpec<Float> = spring(),
): Float

Scroll by value pixels with animation.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

Parameters

value number of pixels to scroll by
animationSpec AnimationSpec to be used for this scrolling

Return

the amount of scroll consumed

animateScrollBy

Source set: Common
public suspend fun Scrollable2DState.animateScrollBy(
    value: Offset,
    animationSpec: AnimationSpec<Offset> = spring(),
): Offset

Scroll by value pixels with animation.

Cancels the currently running scroll, if any, and suspends until the cancellation is complete.

Parameters

value number of pixels to scroll by
animationSpec AnimationSpec to be used for this scrolling

Return

the amount of scroll consumed

Jetpack Compose beyond MaterialFree components, screens and templates for apps that don’t look like Google’s. Copy them into your app, or let your coding agent add them.Browse for free

Content updated: