https://kotlinlang.org logo
g

Grigorii Yurkov

11/05/2020, 3:54 PM
Can we replace
ValueAnimator
with some function from compose, or we still have to use it? In my case I need to show
CircularProgressIndicator
animation from 0% to 100% with 500ms duration triggered by button click
m

matvei

11/05/2020, 3:57 PM
Take a look at the samples in
CircularProgressIndicator
documentation. I think they highlight your usecase perfectly.
g

Grigorii Yurkov

11/05/2020, 4:30 PM
I don't think it's what i need. For example, at the beginning I have `x`%, after clicking I want to instantly set 0% and then animate the change from 0% to 100%.
animate
just doesn't let me set values instantly, it animates all changes.
l

Louis Pullen-Freilich [G]

11/05/2020, 6:17 PM
If you need more finely grained control you can use an
animatedFloat
instead of
animate
👍 1
2 Views