mirror of
https://github.com/mihonapp/mihon.git
synced 2024-11-07 11:17:25 +01:00
Fix scrolling issue
This commit is contained in:
parent
6cbdbb5be3
commit
46a0820e5c
@ -119,7 +119,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli
|
|||||||
override fun onResume() {
|
override fun onResume() {
|
||||||
super.onResume()
|
super.onResume()
|
||||||
libraryMangaSubscription = libraryPresenter.libraryMangaSubject
|
libraryMangaSubscription = libraryPresenter.libraryMangaSubject
|
||||||
.subscribe({ onNextLibraryManga(it) })
|
.subscribe { if (it != null) onNextLibraryManga(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPause() {
|
override fun onPause() {
|
||||||
@ -139,7 +139,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli
|
|||||||
*
|
*
|
||||||
* @param event the event received.
|
* @param event the event received.
|
||||||
*/
|
*/
|
||||||
fun onNextLibraryManga(event: LibraryMangaEvent?) {
|
fun onNextLibraryManga(event: LibraryMangaEvent) {
|
||||||
// Get the categories from the parent fragment.
|
// Get the categories from the parent fragment.
|
||||||
val categories = libraryFragment.adapter.categories ?: return
|
val categories = libraryFragment.adapter.categories ?: return
|
||||||
|
|
||||||
@ -147,7 +147,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli
|
|||||||
if (position >= categories.size) return
|
if (position >= categories.size) return
|
||||||
|
|
||||||
// Get the manga list for this category
|
// Get the manga list for this category
|
||||||
val mangaForCategory = event?.getMangasForCategory(categories[position])
|
val mangaForCategory = event.getMangasForCategory(categories[position])
|
||||||
|
|
||||||
// Update the list only if the reference to the list is different, avoiding reseting the
|
// Update the list only if the reference to the list is different, avoiding reseting the
|
||||||
// adapter after every onResume.
|
// adapter after every onResume.
|
||||||
|
Loading…
Reference in New Issue
Block a user