animateFloatAsState
Fire-and-forget animation function for Float. This Composable function is overloaded for different parameter types such as Color, IntOffset, etc. When the provided targetValue is changed, the animation will run automatically. If there is already an animation in-flight when targetValue changes, the on-going animation will adjust course to animate towards the new target value.
animateFloatAsState returns a State object. The value of the state object will continuously be updated by the animation until the animation finishes.
Note, animateFloatAsState cannot be canceled/stopped without removing this composable function from the tree. See com.jakewharton.mosaic.animation.Animatable for cancelable animations.
Return
A State object, the value of which is updated by animation.
Parameters
Target value of the animation
The animation that will be used to change the value through time. com.jakewharton.mosaic.animation.spring will be used by default.
An optional threshold for deciding when the animation value is considered close enough to the targetValue.
An optional label to differentiate from other animations.
An optional end listener to get notified when the animation is finished.