Assigned
Status Update
Comments
os...@google.com <os...@google.com>
os...@google.com <os...@google.com> #2
Can you try with the latest snapshot? Not reproducible for me on androidx-main.
ap...@google.com <ap...@google.com> #3
Ok, after trying a couple more versions, realized this is a duplicate of
From the release notes:
AndroidView's update callback's first invocation will now be defered until the view is attached, instead of running when the composition that introduces the AndroidView is applied. This fixes a bug where the update callback wouldn't be invalidated if a state it read was changed immediately by an effect. (Ie9438,
) b/291094055
Sorry for the confusion!
Description
Jetpack Compose version: BOM 2025.01.01 = animation-core 1.7.7
Jetpack Compose component used:
createChildTransition
Android Studio Build: Ladybug Feature Drop | 2024.2.2
Kotlin version: 2.1.10
Example using
MutableTransitionState
:Experimenting with this, it seems if the
state
object alternates between states1
and2
, the correct transition is used. But if the state object ever ends up at any other value, the next time a color transition is made, it happens almost immediately.Experimenting with
SeekableTransitionState
results in something similar, but only the first time the transition happens.Running the debugger, it seemed the reason the transition was happening quickly is coming from the
TransitionAnimationState#updateTargetValue
function. In the cases when the transition happens quickly, it looks like theisInterrupted
argument toupdateAnimation
istrue
, and is causing it to use theinterruptionSpec
instead.SeekableTransitionState
somehow bypasses this on following calls becauseisSeeking
istrue
. But I could be totally wrong and gotten turned around in the code.