androidx.compose.foundation.gestures
TargetedFlingBehavior
Interface · from org.jetbrains.compose.foundation:foundation:1.12.2
No hand-written docs yet.
Interface to specify fling behavior with additional information about its animation target.
interface TargetedFlingBehavior : FlingBehavior
Is a
How to get one
Ready-made values and functions that return it
CarouselDefaults:singleAdvanceFlingBehavior(),multiBrowseFlingBehavior(),noSnapFlingBehavior()PagerDefaults:flingBehavior()
Used by
Parameters that take a TargetedFlingBehavior.
HorizontalCenteredHeroCarousel(flingBehavior)HorizontalMultiBrowseCarousel(flingBehavior)HorizontalPager(flingBehavior)HorizontalUncontainedCarousel(flingBehavior)VerticalPager(flingBehavior)
Functions
performFling
fun ScrollScope.performFling(initialVelocity: Float, onRemainingDistanceUpdated: (Float) -> Unit): Float
Perform settling via fling animation with given velocity and suspend until fling has finished. Use onRemainingDistanceUpdated to report the status of the ongoing fling animation and the remaining amount of scroll offset.
Library docs
Interface to specify fling behavior with additional information about its animation target.