Can anyone explain this? Is it a compose bug? `pr...
# compose
k
Can anyone explain this? Is it a compose bug?
println("a: $progress")
works normally, but
println("b: $progress")
will miss following values, leading to UI not updated.
progress
is the value of float
Animatable
.
n
i didn't understand your bug
k
The progress is not updated in the graphics layer modifier, but updated in the draw behind and other modifiers
It's running a progress animation
t
reading a state inside
block
will only cause the layer properties update without triggering recomposition and relayout.
If
progress
isn't backed by mutable state, then you should use the other overload:
Copy code
.graphicsLayer(
    translationX = ...,
    translationY = ...
)
I'm noticing that referencing
progress
isn't marked as a "State read" in your IDE so I think this is the case.
k
but when I inline it as
animation.value
which is a mutable state, the issue still persists