```AnimatedVisibility(visible = true, initiallyVis...
# compose
r
Copy code
AnimatedVisibility(visible = true, initiallyVisible = false, enter = fadeIn()) { //<=beta06
initiallyVisible
is removed in
beta07
Copy code
@ExperimentalAnimationApi
@Composable
fun AnimatedVisibility(
    visible: Boolean,
    modifier: Modifier = Modifier,
    enter: EnterTransition = fadeIn() + expandIn(),
    exit: ExitTransition = shrinkOut() + fadeOut(),
    content: @Composable() AnimatedVisibilityScope.() -> Unit
) {
    val transition = updateTransition(visible)
    AnimatedEnterExitImpl(transition, { it }, modifier, enter, exit, content)
}
z
Yep that’s mentioned in the release notes
d
Yes. The motivation for removing
initiallyVisible
is to eliminate the guess work around what should happen when
initiallyVisible
changes: should it 1) start a new animation, or 2) ignore it if
visible
parameter didn't change? It's more clear to express the
initiallyVisible
equivalent in a
MutableTransitionState
, where the if you were to change the initial state you'll have to create a new
MutableTransitionState
instance. A new instance would lead to a new animation if the targetState and currentState differ.
🙏🏼 1
🎉 1
👍 3
👍🏼 1