Function

settle

Find the closest anchor, taking into account the velocityThreshold and positionalThreshold, and settle at it with an animation.

settle

Source set: Common
suspend fun settle(velocity: Float)

Find the closest anchor, taking into account the velocityThreshold and positionalThreshold, and settle at it with an animation.

If the velocity is lower than the velocityThreshold, the closest anchor by distance and positionalThreshold will be the target. If the velocity is higher than the velocityThreshold, the positionalThreshold will not be considered and the next anchor in the direction indicated by the sign of the velocity will be the target.

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: