Tomáš Hubálek06/25/2021, 7:50 AM
Oleksandr Karpovich [JB]06/25/2021, 8:44 AM
I'm thinking whether it is possible somehow just show and hide that indiciator without recomposing it.Does the indicator get shown under some condition? like:
In this case it should not be a part of the composition at all when the condition is false. Is it possible to provide a code example to showcase your problem?
if (showIndicator) LoadingIndicator()
Tomáš Hubálek06/25/2021, 9:33 AM
and stopped every time
is disposed. So I would like to make that indicator running forever (it is pure CSS solution, no JS) but just hide it when nothing happens.
Oleksandr Karpovich [JB]06/25/2021, 10:07 AM
might be one of the options although I don't think it will help avoid flickering when the state gets changed often. another solution could be to use some kind of debounce for changing the loading state. So it doesn't hide immediately but in 100ms for example. and to apply this debounced loading state to hidden() attribute. The problem with this solution is that it's not known what number (ms) should one use for debounce (what number suits the best). https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/debounce.html
Tomáš Hubálek06/25/2021, 10:08 AM