fix: Use show()/hide() to ensure animation is delayed (#834)

This commit is contained in:
Nik Clayton 2024-07-24 17:20:44 +02:00 committed by GitHub
parent e4a305f608
commit bad502e6c3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 1 deletions

View File

@ -86,7 +86,11 @@ abstract class SearchFragment<T : Any> :
val isNewSearch = currentQuery != viewModel.currentQuery 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) binding.searchRecyclerView.visible(loadState.refresh is LoadState.NotLoading || !isNewSearch || binding.swipeRefreshLayout.isRefreshing)
if (loadState.refresh != LoadState.Loading) { if (loadState.refresh != LoadState.Loading) {