From bad502e6c3d361c0d8158d849a47865d65a8b4dd Mon Sep 17 00:00:00 2001 From: Nik Clayton Date: Wed, 24 Jul 2024 17:20:44 +0200 Subject: [PATCH] fix: Use show()/hide() to ensure animation is delayed (#834) --- .../pachli/components/search/fragments/SearchFragment.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/pachli/components/search/fragments/SearchFragment.kt b/app/src/main/java/app/pachli/components/search/fragments/SearchFragment.kt index 26c994596..e65f21d39 100644 --- a/app/src/main/java/app/pachli/components/search/fragments/SearchFragment.kt +++ b/app/src/main/java/app/pachli/components/search/fragments/SearchFragment.kt @@ -86,7 +86,11 @@ abstract class SearchFragment : val isNewSearch = currentQuery != viewModel.currentQuery - binding.searchProgressBar.visible(loadState.refresh == LoadState.Loading && isNewSearch && !binding.swipeRefreshLayout.isRefreshing) + if (loadState.refresh == LoadState.Loading && isNewSearch && !binding.swipeRefreshLayout.isRefreshing) { + binding.searchProgressBar.show() + } else { + binding.searchProgressBar.hide() + } binding.searchRecyclerView.visible(loadState.refresh is LoadState.NotLoading || !isNewSearch || binding.swipeRefreshLayout.isRefreshing) if (loadState.refresh != LoadState.Loading) {