In jetpack compose how do you use timers? I have ...
# compose
j
In jetpack compose how do you use timers? I have a progress bar that I want to continuously cycle until I get a response back from my servers. I was googling a bit but not getting much useful info. Maybe timer or clock isnt the right name to google?
a
You can use a LinearProgressIndicator i think which is indeterminant. https://stackoverflow.com/questions/59825217/how-can-i-render-plain-android-progressbar-with-compose
j
Yeah I've got the progress bar built into the UI but i need to update it with a clock function every second so its animated
a
LinearProgressIndicator is animated if you don't give it a progress value. May be your looking for something else. Here is an example of what it looks like in case you want to see https://github.com/Foso/Jetpack-Compose-Playground/material/linearprogressindicator/
j
ohhh ok I see
I got it working now thanks!