Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Hi Ed, Thank you so much for these suggestions. I've been reviewing them and merging them in. Hopefully it should be live. I've included a thank you note too in the article.
Description
Coroutine scopes derived from a composition using the
rememberCoroutineScope()
andlaunchInComposition
APIs should have theRecomposer
'sMonotonicFrameClock
in theircoroutineContext
s. The absence of this causes jank in animations performed using thewithFrameNanos
API family as ordering of frame operations with regard to the recomposer loop are not guaranteed. This bug was masked by theCompositionCoroutineScope
receiver used bylaunchInComposition
implementing the frame clock interface and providing the correct one through that side channel.Install the correct frame clock into the
coroutineContext
and removeCompositionCoroutineScope
's interface implementation ofMonotonicFrameClock
.