mirror of
https://github.com/tachiyomiorg/tachiyomi.git
synced 2024-11-10 01:55:06 +01:00
Fixed fade in animation on first startup of library
This commit is contained in:
parent
ecbb55f058
commit
ee6d2927f9
@ -146,6 +146,7 @@ class LibraryController(
|
|||||||
var presenter = LibraryPresenter(this)
|
var presenter = LibraryPresenter(this)
|
||||||
private set
|
private set
|
||||||
|
|
||||||
|
private var justStarted = true
|
||||||
|
|
||||||
init {
|
init {
|
||||||
setHasOptionsMenu(true)
|
setHasOptionsMenu(true)
|
||||||
@ -299,7 +300,8 @@ class LibraryController(
|
|||||||
tabsVisibilitySubscription = null
|
tabsVisibilitySubscription = null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun onNextLibraryUpdate(categories: List<Category>, mangaMap: Map<Int, List<LibraryItem>>) {
|
fun onNextLibraryUpdate(categories: List<Category>, mangaMap: Map<Int, List<LibraryItem>>,
|
||||||
|
freshStart: Boolean = false) {
|
||||||
val view = view ?: return
|
val view = view ?: return
|
||||||
val adapter = adapter ?: return
|
val adapter = adapter ?: return
|
||||||
|
|
||||||
@ -330,15 +332,20 @@ class LibraryController(
|
|||||||
|
|
||||||
tabsVisibilityRelay.call(categories.size > 1)
|
tabsVisibilityRelay.call(categories.size > 1)
|
||||||
|
|
||||||
// Delay the scroll position to allow the view to be properly measured.
|
if (freshStart || !justStarted) {
|
||||||
view.post {
|
// Delay the scroll position to allow the view to be properly measured.
|
||||||
if (isAttached) {
|
view.post {
|
||||||
activity?.tabs?.setScrollPosition(library_pager.currentItem, 0f, true)
|
if (isAttached) {
|
||||||
|
activity?.tabs?.setScrollPosition(library_pager.currentItem, 0f, true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Send the manga map to child fragments after the adapter is updated.
|
// Send the manga map to child fragments after the adapter is updated.
|
||||||
libraryMangaRelay.call(LibraryMangaEvent(mangaMap))
|
libraryMangaRelay.call(LibraryMangaEvent(mangaMap))
|
||||||
|
}
|
||||||
|
else if (!freshStart) {
|
||||||
|
justStarted = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ class LibraryPresenter(
|
|||||||
mangaMap
|
mangaMap
|
||||||
}()
|
}()
|
||||||
currentMangaMap = mangaMap
|
currentMangaMap = mangaMap
|
||||||
view.onNextLibraryUpdate(categories, mangaMap)
|
view.onNextLibraryUpdate(categories, mangaMap, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
fun getAllManga(): LibraryMap? {
|
fun getAllManga(): LibraryMap? {
|
||||||
|
Loading…
Reference in New Issue
Block a user