From 46a0820e5cbff3eb219a32cf011b0bb1dc19e911 Mon Sep 17 00:00:00 2001 From: len Date: Wed, 13 Apr 2016 02:08:43 +0200 Subject: [PATCH] Fix scrolling issue --- .../kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt index 6a2a1faa73..0c4819083e 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryFragment.kt @@ -119,7 +119,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli override fun onResume() { super.onResume() libraryMangaSubscription = libraryPresenter.libraryMangaSubject - .subscribe({ onNextLibraryManga(it) }) + .subscribe { if (it != null) onNextLibraryManga(it) } } override fun onPause() { @@ -139,7 +139,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli * * @param event the event received. */ - fun onNextLibraryManga(event: LibraryMangaEvent?) { + fun onNextLibraryManga(event: LibraryMangaEvent) { // Get the categories from the parent fragment. val categories = libraryFragment.adapter.categories ?: return @@ -147,7 +147,7 @@ class LibraryCategoryFragment : BaseFragment(), FlexibleViewHolder.OnListItemCli if (position >= categories.size) return // 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 // adapter after every onResume.