Hey What is the best way to deal with button click...
# android
i
Hey What is the best way to deal with button clicks debouncing and Kotlin Android Extensions? Is there any simple way to debounce clicks for whole app?
l
There's no "best" way, there's multiple approaches. I personally has not needed to debounce button clicks, because for one shot actions, I just disable the button entirely until some processing is done, if the button ever needs to be re-enabled. However, if I needed to do it, I'd probably use #coroutines to do it, maybe using a for loop,
delay(...)
and this
awaitOneClick()
extension function I wrote: https://gist.github.com/LouisCAD/c91f971c9771036f6af14fde3527e42a
i
Grey area s usual ­čśë thx @louiscad