In pre-compose days we had a rule: no animation in...
# compose
d
In pre-compose days we had a rule: no animation inside layouts (during measure etc). Do I understand correctly that in Compose this restriction is somewhat lifted? I.e. can I safely do val state: State<Dp> a) modifier = Modifier.width(state.value) b) Layout({}) { measurables, constraints -> layout(state.roundToPx(), state.roundToPx()) { ... } } Are there any restrictions or guidelines on what to do or not do regrading animations and (custom) layouts? Are they documented somewhere?
s
You can do both, although the second one is much faster, as animation changes are observed only in measure
d
Nice to know, thanks!