79420493

Date: 2025-02-07 10:16:50
Score: 2
Natty:
Report link

I suspect that vm.setLoading(false) immediately executed if uiState.data is empty.

Replace

vm.setLoading(false)

on

if(uiState.data.isNotEmpty())
{
  vm.setLoading(false)
}

The example using LiveData for a view state and CircularProgressIndicator: https://github.com/kl-demo/mvvm-compose-hilt-example/blob/main/app/src/main/java/kldemo/mvvmcomposehiltexample/presentation/langs/ProgrammingLanguagesScreenScreen.kt#L66

Reasons:
  • Probably link only (1):
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Kirill