Spring

class Spring
kotlin.Any
   ↳ androidx.animation.Spring

Physics class contains a number of recommended configurations for physics animations.

Summary

Constants

const Float

Damping ratio for a very bouncy spring.

const Float

Damping ratio for a spring with low bounciness.

const Float

Damping ratio for a medium bouncy spring.

const Float

Damping ratio for a spring with no bounciness.

const Float

Stiffness constant for extremely stiff spring

const Float

Stiffness constant for a spring with low stiffness.

const Float

Stiffness constant for medium stiff spring.

const Float

Stiffness constant for a spring with very low stiffness.

Public constructors

Physics class contains a number of recommended configurations for physics animations.

Constants

DampingRatioHighBouncy

const val DampingRatioHighBouncy: Float

Damping ratio for a very bouncy spring. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the more bouncy the spring.

Value: 0.2f

DampingRatioLowBouncy

const val DampingRatioLowBouncy: Float

Damping ratio for a spring with low bounciness. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the higher the bounciness.

Value: 0.75f

DampingRatioMediumBouncy

const val DampingRatioMediumBouncy: Float

Damping ratio for a medium bouncy spring. This is also the default damping ratio for spring force. Note for under-damped springs (i.e. damping ratio < 1), the lower the damping ratio, the more bouncy the spring.

Value: 0.5f

DampingRatioNoBouncy

const val DampingRatioNoBouncy: Float

Damping ratio for a spring with no bounciness. This damping ratio will create a critically damped spring that returns to equilibrium within the shortest amount of time without oscillating.

Value: 1f

StiffnessHigh

const val StiffnessHigh: Float

Stiffness constant for extremely stiff spring

Value: 10_000f

StiffnessLow

const val StiffnessLow: Float

Stiffness constant for a spring with low stiffness.

Value: 200f

StiffnessMedium

const val StiffnessMedium: Float

Stiffness constant for medium stiff spring. This is the default stiffness for spring force.

Value: 1500f

StiffnessVeryLow

const val StiffnessVeryLow: Float

Stiffness constant for a spring with very low stiffness.

Value: 50f

Public constructors

<init>

Spring()

Physics class contains a number of recommended configurations for physics animations.