Great, thanks! Is there some way I can cancel the animation? Like if an event occurs it should stop animating further
Se7eN
10/11/2020, 2:51 PM
Nvm found it.
stop()
c
caelum19
10/12/2020, 6:55 PM
Here's a modal progress bar, in case you want to stop the user from doing anything until you're done.
Copy code
for (i in 0 .. 100) {
Thread.sleep(1000)
LinearProgressIndicator(progress = i.toFloat())
}
Benefits:
⢠No need to complicate your codebase with cancelling animations or allowing pesky users to break things while you're working
⢠Long artificial waiting time gives the illusion that more is being done than really is
⢠Crashing entire interface until done prevents user from switching to competing apps
(š§ )