FloatExponentialDecaySpec
This is a decay animation where the friction/deceleration is always proportional to the velocity. As a result, the velocity goes under an exponential decay. The constructor parameter, frictionMultiplier
, can be tuned to adjust the amount of friction applied in the decay. The higher the multiplier, the higher the friction, the sooner the animation will stop, and the shorter distance the animation will travel with the same starting condition.
Parameters
The friction multiplier, indicating how quickly the animation should stop. This should be greater than 0
, with a default value of 1.0
.
The speed at which the animation is considered close enough to rest for the animation to finish.
Properties
Functions
Creates a DecayAnimationSpec from a com.jakewharton.mosaic.animation.FloatDecayAnimationSpec by applying the given com.jakewharton.mosaic.animation.FloatDecayAnimationSpec on every dimension of the AnimationVector that T converts to.
Returns the duration of the decay animation, in nanoseconds.
Returns the target value of the animation based on the starting condition of the animation ( i.e. start value and start velocity).
Returns the value of the animation at the given time.
Returns the velocity of the animation at the given time.