Tomáš Hubálek
06/25/2021, 7:50 AMOleksandr Karpovich [JB]
06/25/2021, 8:44 AMI'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:
if (showIndicator) LoadingIndicator()
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?Tomáš Hubálek
06/25/2021, 9:33 AMLoadingIndicator()
and stopped every time LoadingIndicator()
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 AMhidden()
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.htmlTomáš Hubálek
06/25/2021, 10:08 AMvisibility
css property.