Join Slack
Powered by
In jetpack compose how do you use timers? I have ...
# compose
j
Jason Inbody
08/09/2021, 2:02 AM
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
Abhishek Dewan
08/09/2021, 2:13 AM
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
Jason Inbody
08/09/2021, 2:15 AM
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
Abhishek Dewan
08/09/2021, 2:21 AM
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
Jason Inbody
08/09/2021, 2:25 AM
ohhh ok I see
Jason Inbody
08/09/2021, 2:25 AM
I got it working now thanks!
18
Views
Open in Slack
Previous
Next