fix: Use show()/hide() to ensure animation is delayed (#834)
This commit is contained in:
parent
e4a305f608
commit
bad502e6c3
|
@ -86,7 +86,11 @@ abstract class SearchFragment<T : Any> :
|
|||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue