seekTo
suspend fun seekTo(@FloatRange(from = 0.0, to = 1.0) fraction: Float, targetState: S = this.targetState)
Starts seeking the transition to targetState with fraction used to indicate the progress towards targetState. If the previous targetState
was already targetState then seekTo only stops any current animation towards that state and snaps the fraction to the new value. Otherwise, the currentState is changed to the former targetState
and targetState
is changed to targetState and an animation is started, moving the start values towards the former targetState
. This will return when the initial values have reached currentState
and the fraction has been reached.
snapTo also allows the developer to change the state, but does not animate any values. Instead, it instantly moves all values to those at the new targetState.