+27
−7
Loading
Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more
This CL replaces AnimatedState.valueOrNull by a new function unsafeCompositionState() that returns a State that won't throw if it is read during composition. This ensures that callers don't try to access this value when the associated Element object is not in its map yet, which would happen once we add the Element in a DisposableEffect or in a Node.onAttach() method. Before this CL, values coming from valueOrNull could sometimes be one frame behind and sometimes not, depending on timings and composition order. With this CL, values read through unsafeCompositionState() will consistently be one frame behind. That way, the behavior is consistent and easy to reason about. Bug: 291071158 Test: AnimatedSharedAsStateTest Flag: N/A Change-Id: I75dcadaabdd6b3d314744fdde336b79115af0755