fix progressbar never stopping

This commit is contained in:
Matthieu 2021-04-29 15:55:49 +02:00
parent ac2eca9e57
commit 49df7279b2
1 changed files with 1 additions and 1 deletions

View File

@ -60,7 +60,7 @@ internal fun <T: Any> initAdapter(
// ProgressBar should stop showing as soon as the source stops loading ("source"
// meaning the database, so don't wait on the network)
val sourceLoading = loadState.source.refresh is LoadState.Loading
if(!sourceLoading && recyclerView.size > 0){
if(!sourceLoading && adapter.itemCount > 0){
recyclerView.isVisible = true
progressBar.isVisible = false
} else if(adapter.itemCount == 0