public class MutableTransitionState<S>(initialState: S) : TransitionState<S>()
MutableTransitionState contains two fields: currentState and targetState. currentState is initialized to the provided initialState, and can only be mutated by a Transition. targetState is also initialized to initialState. It can be mutated to alter the course of a transition animation that is created with the MutableTransitionState using rememberTransition. Both currentState and targetState are backed by a State object.
Properties
currentState
override var currentState: S by mutableStateOf(initialState)
Current state of the transition. currentState is initialized to the initialState that the MutableTransitionState is constructed with.
It will be updated by the Transition that is created with this MutableTransitionState when the transition arrives at a new state.
targetState
override var targetState: S by mutableStateOf(initialState)
Target state of the transition. targetState is initialized to the initialState that the MutableTransitionState is constructed with.
It can be updated to a new state at any time. When that happens, the Transition that is created with this MutableTransitionState will update its Transition.targetState to the same and subsequently starts a transition animation to animate from the current values to the new target.
isIdle
public val isIdle: Boolean
isIdle returns whether the transition has finished running. This will return false once the targetState has been set to a different value than currentState.
Functions
transitionConfigured
override fun transitionConfigured(transition: Transition<S>)
transitionRemoved
override fun transitionRemoved()