Split SceneScope.MovableElement with SceneSope.Element (1/2)
This CL splits SceneScope.MovableElement() into .MovableElement() and
.Element(). These 2 functions now need to be used to declare animated
shared values. The old way of declaring animated values was removed.
With this CL, declaring an element (movable or not) with animated values
looks like this:
Element(key, modifier) { // or MovableElement(...)
val animatedDp by animateElementDpAsState(targetValue, valueKey)
content {
Box(Modifier.offset { IntOffset(0, animatedDp.roundToPx()) }) {
...
}
}
}
It is a bit more verbose than before, but as explained in
b/317026105#comment3 we have to do this for MovableElement given that
the shared animate values need to be composed separately from the
element content.
Bug: 317026105
Test: PlatformComposeSceneTransitionLayoutTests
Flag: N/A
Change-Id: Ic842c4c6a0c66083830d74f03086408a5436b104
15 files changed