Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Commit 40e53a42 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere
Browse files

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
parent e09d2004
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment