Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-master-dev
commit 44c49090d5f4727e1dc6f883b4345dc0ac487254
Author: Adam Powell <adamp@google.com>
Date: Fri Aug 28 09:02:47 2020
Set MonotonicFrameClock for composition scopes
Install the Recomposer's broadcast frame clock as the CoroutineContext's
MonotonicFrameClock for CoroutineScopes created from composition. This
includes both the launchInComposition and rememberCoroutineScope APIs.
This fixes a bug where users of the withFrameNanos API family would see
the wrong MonotonicFrameClock, leading to animation jank as the ordering
of Choreographer callbacks for the recomposer and the animation with
regard to one another was inconsistent. Installing the Recomposer's clock
into the context allows the Recomposer to control this timing.
Fixes: 166778123
Test: SuspendingEffectsTests.kt
Relnote: "CompositionCoroutineScope no longer implements
MonotonicFrameClock. Callers of withFrameNanos should import the top-level
function explicitly."
Change-Id: Icb642e00a670c235f26d11e6549b4222b2b4c2fb
M compose/runtime/runtime/api/current.txt
M compose/runtime/runtime/api/public_plus_experimental_current.txt
M compose/runtime/runtime/api/restricted_current.txt
M compose/runtime/runtime/src/androidAndroidTest/kotlin/androidx/compose/runtime/SuspendingEffectsTests.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SuspendingEffects.kt
M compose/test-utils/src/androidMain/kotlin/androidx/compose/testutils/AndroidComposeTestCaseRunner.kt
https://android-review.googlesource.com/1413685
Branch: androidx-master-dev
commit 44c49090d5f4727e1dc6f883b4345dc0ac487254
Author: Adam Powell <adamp@google.com>
Date: Fri Aug 28 09:02:47 2020
Set MonotonicFrameClock for composition scopes
Install the Recomposer's broadcast frame clock as the CoroutineContext's
MonotonicFrameClock for CoroutineScopes created from composition. This
includes both the launchInComposition and rememberCoroutineScope APIs.
This fixes a bug where users of the withFrameNanos API family would see
the wrong MonotonicFrameClock, leading to animation jank as the ordering
of Choreographer callbacks for the recomposer and the animation with
regard to one another was inconsistent. Installing the Recomposer's clock
into the context allows the Recomposer to control this timing.
Fixes: 166778123
Test: SuspendingEffectsTests.kt
Relnote: "CompositionCoroutineScope no longer implements
MonotonicFrameClock. Callers of withFrameNanos should import the top-level
function explicitly."
Change-Id: Icb642e00a670c235f26d11e6549b4222b2b4c2fb
M compose/runtime/runtime/api/current.txt
M compose/runtime/runtime/api/public_plus_experimental_current.txt
M compose/runtime/runtime/api/restricted_current.txt
M compose/runtime/runtime/src/androidAndroidTest/kotlin/androidx/compose/runtime/SuspendingEffectsTests.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/Recomposer.kt
M compose/runtime/runtime/src/commonMain/kotlin/androidx/compose/runtime/SuspendingEffects.kt
M compose/test-utils/src/androidMain/kotlin/androidx/compose/testutils/AndroidComposeTestCaseRunner.kt
Description
I wrote tests for the behaviour I want us to have, but I don't know how to implement it:
it works if we add keys manually:
for (i in 0..1) {
key(i) {
keys[i] = composer.currentCompoundKeyHash
}
}
but I hope we can do something like this automatically as otherwise it is a huge limitation for the savedInstanceState() usage