Revert "Scroll to top after refreshing" (#139)
* Revert "Fix progress not showing after clicking error tip" This reverts commitbc914566dd. * Revert "Try to fix recyclerview disappearing after refresh (#61)" This reverts commitf9a3c3d266. * Revert "Scroll to top after refreshing" This reverts commitb0896ea465.
This commit is contained in:
1 parent
f7d45a52a7
commit
93df4e3dd9
2 files changed
+4
-22
No files matched your search
@@ -102,7 +102,6 @@ import rikka.core.res.resolveColor
|
||||
// Note that we do not really follow mvvm structure, just use it as ... storage
|
||||
class VMStorage : ViewModel() {
|
||||
var urlBuilder = FavListUrlBuilder(favCat = Settings.recentFavCat)
|
||||
var shouldScrollToTop = false
|
||||
private val cloudDataFlow = Pager(PagingConfig(25)) {
|
||||
object : PagingSource<String, BaseGalleryInfo>() {
|
||||
override fun getRefreshKey(state: PagingState<String, BaseGalleryInfo>): String? = null
|
||||
@@ -119,7 +118,6 @@ class VMStorage : ViewModel() {
|
||||
} else {
|
||||
urlBuilder.setIndex(key, false)
|
||||
}
|
||||
shouldScrollToTop = true
|
||||
}
|
||||
}
|
||||
val r = runSuspendCatching {
|
||||
@@ -347,10 +345,7 @@ class FavoritesScene : SearchBarScene() {
|
||||
is LoadState.Loading -> {
|
||||
showSearchBar()
|
||||
if (!binding.refreshLayout.isRefreshing) {
|
||||
// https://github.com/FooIbar/EhViewer/issues/45
|
||||
// transition.showView(1)
|
||||
transition.showView(0, false)
|
||||
binding.refreshLayout.isRefreshing = true
|
||||
transition.showView(1)
|
||||
}
|
||||
}
|
||||
is LoadState.Error -> {
|
||||
@@ -364,11 +359,7 @@ 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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -127,7 +127,6 @@ import rikka.core.res.resolveColor
|
||||
|
||||
class VMStorage1 : ViewModel() {
|
||||
var urlBuilder = ListUrlBuilder()
|
||||
var shouldScrollToTop = false
|
||||
val dataFlow = Pager(PagingConfig(25)) {
|
||||
object : PagingSource<String, BaseGalleryInfo>() {
|
||||
override fun getRefreshKey(state: PagingState<String, BaseGalleryInfo>): String? = null
|
||||
@@ -158,7 +157,6 @@ class VMStorage1 : ViewModel() {
|
||||
} else {
|
||||
urlBuilder.setIndex(key, false)
|
||||
}
|
||||
shouldScrollToTop = true
|
||||
}
|
||||
}
|
||||
val r = runSuspendCatching {
|
||||
@@ -383,10 +381,7 @@ class GalleryListScene : SearchBarScene() {
|
||||
is LoadState.Loading -> {
|
||||
showSearchBar()
|
||||
if (!binding.refreshLayout.isRefreshing) {
|
||||
// https://github.com/FooIbar/EhViewer/issues/45
|
||||
// transition.showView(1)
|
||||
transition.showView(0, false)
|
||||
binding.refreshLayout.isRefreshing = true
|
||||
transition.showView(1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -412,11 +407,7 @@ 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