Object

Spring

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

Source set: Common
public object Spring

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

Properties

StiffnessHigh

Source set: Common
public const val StiffnessHigh: Float = 10_000f

Stiffness constant for extremely stiff spring

StiffnessMedium

Source set: Common
public const val StiffnessMedium: Float = 1500f

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

StiffnessMediumLow

Source set: Common
public const val StiffnessMediumLow: Float = 400f

Stiffness constant for medium-low stiff spring. This is the default stiffness for springs used in enter/exit transitions.

StiffnessLow

Source set: Common
public const val StiffnessLow: Float = 200f

Stiffness constant for a spring with low stiffness.

StiffnessVeryLow

Source set: Common
public const val StiffnessVeryLow: Float = 50f

Stiffness constant for a spring with very low stiffness.

DampingRatioHighBouncy

Source set: Common
public const val DampingRatioHighBouncy: Float = 0.2f

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.

DampingRatioMediumBouncy

Source set: Common
public const val DampingRatioMediumBouncy: Float = 0.5f

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.

DampingRatioLowBouncy

Source set: Common
public const val DampingRatioLowBouncy: Float = 0.75f

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.

DampingRatioNoBouncy

Source set: Common
public const val DampingRatioNoBouncy: Float = 1f

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.

DefaultDisplacementThreshold

Source set: Common
public const val DefaultDisplacementThreshold: Float = 0.01f

Default cutoff for rounding off physics based animations

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: