Try to fix recyclerview disappearing after refresh (#61)
* Try to fix recyclerview disappearing after refresh * Another attempt * Workaround: Use RefreshLayout's progress indicator
This commit is contained in:
1 parent
7db04e4359
commit
f9a3c3d266
2 files changed
+8
-4
No files matched your search
@@ -346,7 +346,9 @@ class FavoritesScene : SearchBarScene() {
|
||||
is LoadState.Loading -> {
|
||||
showSearchBar()
|
||||
if (!binding.refreshLayout.isRefreshing) {
|
||||
transition.showView(1)
|
||||
// https://github.com/FooIbar/EhViewer/issues/45
|
||||
// transition.showView(1)
|
||||
binding.refreshLayout.isRefreshing = true
|
||||
}
|
||||
}
|
||||
is LoadState.Error -> {
|
||||
@@ -361,11 +363,11 @@ class FavoritesScene : SearchBarScene() {
|
||||
binding.tip.text = empty
|
||||
transition.showView(2)
|
||||
} else {
|
||||
transition.showView(0, false)
|
||||
if (vm.shouldScrollToTop) {
|
||||
vm.shouldScrollToTop = false
|
||||
binding.recyclerView.scrollToPosition(0)
|
||||
}
|
||||
transition.showView(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -379,7 +379,9 @@ class GalleryListScene : SearchBarScene() {
|
||||
is LoadState.Loading -> {
|
||||
showSearchBar()
|
||||
if (!binding.refreshLayout.isRefreshing) {
|
||||
transition.showView(1)
|
||||
// https://github.com/FooIbar/EhViewer/issues/45
|
||||
// transition.showView(1)
|
||||
binding.refreshLayout.isRefreshing = true
|
||||
}
|
||||
}
|
||||
is LoadState.Error -> {
|
||||
@@ -404,11 +406,11 @@ class GalleryListScene : SearchBarScene() {
|
||||
binding.tip.text = empty
|
||||
transition.showView(2)
|
||||
} else {
|
||||
transition.showView(0, false)
|
||||
if (vm.shouldScrollToTop) {
|
||||
vm.shouldScrollToTop = false
|
||||
binding.recyclerView.scrollToPosition(0)
|
||||
}
|
||||
transition.showView(0)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user