From 49df7279b205ae6f4033d3fb2108363c0c3dc235 Mon Sep 17 00:00:00 2001 From: Matthieu <24-artectrex@users.noreply.shinice.net> Date: Thu, 29 Apr 2021 15:55:49 +0200 Subject: [PATCH] fix progressbar never stopping --- .../org/pixeldroid/app/posts/feeds/CommonFeedFragmentUtils.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/src/main/java/org/pixeldroid/app/posts/feeds/CommonFeedFragmentUtils.kt b/app/src/main/java/org/pixeldroid/app/posts/feeds/CommonFeedFragmentUtils.kt index cbded157..654c9639 100644 --- a/app/src/main/java/org/pixeldroid/app/posts/feeds/CommonFeedFragmentUtils.kt +++ b/app/src/main/java/org/pixeldroid/app/posts/feeds/CommonFeedFragmentUtils.kt @@ -60,7 +60,7 @@ internal fun 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