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

AndroidFlingCalculator

class AndroidFlingCalculator
kotlin.Any
   ↳ androidx.ui.foundation.animation.AndroidFlingCalculator

Configuration for Android-feel flinging motion at the given density.

Summary

Nested classes
data

Info about a fling started with initialVelocity.

Public constructors
<init>(density: Density)

Configuration for Android-feel flinging motion at the given density.

Public methods
Float
flingDistance(velocity: Float)

Compute the distance of a fling in units given an initial velocity of units/second

Long
flingDuration(velocity: Float)

Compute the duration in milliseconds of a fling with an initial velocity of velocity

AndroidFlingCalculator.FlingInfo
flingInfo(velocity: Float)

Compute all interesting information about a fling of initial velocity velocity.

Properties
Density

density of the screen.

Public constructors

<init>

AndroidFlingCalculator(density: Density)

Configuration for Android-feel flinging motion at the given density.

Parameters
density: Density density of the screen. Use DensityAmbient to get current density in composition.

Public methods

flingDistance

fun flingDistance(velocity: Float): Float

Compute the distance of a fling in units given an initial velocity of units/second

flingDuration

fun flingDuration(velocity: Float): Long

Compute the duration in milliseconds of a fling with an initial velocity of velocity

flingInfo

fun flingInfo(velocity: Float): AndroidFlingCalculator.FlingInfo

Compute all interesting information about a fling of initial velocity velocity.

Properties

density

val density: Density

density of the screen. Use DensityAmbient to get current density in composition.