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

PhysicsBuilder

class PhysicsBuilder<T> : AnimationBuilder<T>
kotlin.Any
   ↳ androidx.animation.AnimationBuilder<T>
   ↳ androidx.animation.PhysicsBuilder

PhysicsBuilder takes in the configuration of a spring as its constructor parameters.

Summary

Public constructors
<init>(dampingRatio: Float = DampingRatioNoBouncy, stiffness: Float = StiffnessMedium, displacementThreshold: T? = null)

PhysicsBuilder takes in the configuration of a spring as its constructor parameters.

Public methods
SpringSpec<V>
build(converter: TwoWayConverter<T, V>)

Properties
Float

Damping ratio of the spring.

Float

Stiffness of the spring.

Public constructors

<init>

PhysicsBuilder(
    dampingRatio: Float = DampingRatioNoBouncy,
    stiffness: Float = StiffnessMedium,
    displacementThreshold: T? = null)

PhysicsBuilder takes in the configuration of a spring as its constructor parameters.

Parameters
dampingRatio: Float = DampingRatioNoBouncy Damping ratio of the spring. Defaults to DampingRatioNoBouncy
stiffness: Float = StiffnessMedium Stiffness of the spring. Defaults to StiffnessVeryLow

Public methods

build

fun <V : AnimationVector> build(converter: TwoWayConverter<T, V>): SpringSpec<V>

Properties

dampingRatio

var dampingRatio: Float

Damping ratio of the spring. Defaults to DampingRatioNoBouncy

stiffness

var stiffness: Float

Stiffness of the spring. Defaults to StiffnessVeryLow