fix from pr (#801)

This commit is contained in:
firelight 2023-12-09 14:04:26 +00:00 committed by GitHub
parent 2d87983eca
commit 3ef8f3030c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 3 deletions

View File

@ -398,7 +398,7 @@ class LibraryFragment : Fragment() {
0,
viewpager.adapter?.itemCount ?: 0
)
binding?.viewpager?.setCurrentItem(libraryViewModel.currentPage, false)
binding?.viewpager?.setCurrentItem(libraryViewModel.getTabPosition().value ?: 0, false)
// Only stop loading after 300ms to hide the fade effect the viewpager produces when updating
// Without this there would be a flashing effect:

View File

@ -41,8 +41,6 @@ class LibraryViewModel : ViewModel() {
private val _pages: MutableLiveData<Resource<List<SyncAPI.Page>>> = MutableLiveData(null)
val pages: LiveData<Resource<List<SyncAPI.Page>>> = _pages
var currentPage: Int = 0
private val _currentApiName: MutableLiveData<String> = MutableLiveData("")
val currentApiName: LiveData<String> = _currentApiName