Hello everyone, Is it possible to perform a transi...
# compose
m
Hello everyone, Is it possible to perform a transition tween animation for width property which starts from a specific
dp
value and ends with
fillMaxWidth
? For example:
Copy code
val width = DpPropKey("width")

val transitionDefinition = transitionDefinition<ButtonState> {
    state(ButtonState.COLLAPSED) {
        this[width] = 60.dp
    }
    state(ButtonState.EXPANDED) {
        this[width] = ??? // how can I represent a `fillMaxWidth` value here?
    }
}
Thanks!
a
Try Modifier.animateContentSize()
m
thanks, will try it. Also, i’ve found out that
WithConstraints
composable may help in this case, as it allows to get the computed width and height values