elye
02/08/2022, 11:54 AMMutableStateTransition
compare to normal mutableStateOf
has to offer. It’s long to describe here, so I have put the inquiry on StackOverflow https://stackoverflow.com/questions/71033419/whats-the-use-of-mutablestatetransition-looks-like-mutablestateof-does-all-i. Hopes to get some insight from you. Thanks 🙏val currentState = remember {
MutableTransitionState(BoxState.Collapsed).apply {
targetState = BoxState.Expanded
}
}
makes full sense.
I think the example code in https://developer.android.com/jetpack/compose/animation#updateTransition should use the above instead of
// Start in collapsed state and immediately animate to expanded
var currentState = remember { MutableTransitionState(BoxState.Collapsed) }
currentState.targetState = BoxState.Expanded
val transition = updateTransition(currentState)
// ...