Any idea how could I implement something like a `C...
# compose
t
Any idea how could I implement something like a
ContentLoadinProgressBar
in compose?
d
looks like box with some logic
if(!showProgress){content()}else{Progress()}
t
It’s more related to delaying the state of the loading. Basically it wait X before showing and if it show, show for minimum X time. My problem is a bit related to delaying the state change. I’m trying to do with
produceState
not sure if this can work
Apparently this solve my problem, so I’m posting here for people in the future:
Copy code
val _isLoading by produceState(false, isLoading) {
    delay(Duration.milliseconds(500))
    value = if (isLoading != value) {
        isLoading
    } else {
        value
    }
}