From 6059b85e58db2a413ebd92953875884dc22b98cc Mon Sep 17 00:00:00 2001 From: inorichi Date: Thu, 27 Jul 2017 09:21:15 +0200 Subject: [PATCH] Fix library category not updatable when empty. Closes #907 --- .../eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt | 2 +- .../tachiyomi/ui/recent_updates/RecentChaptersController.kt | 2 +- app/src/test/java/eu/kanade/tachiyomi/TestApp.kt | 4 ++++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt index e8683a851..0fc43e5e1 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/library/LibraryCategoryView.kt @@ -83,7 +83,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att // Disable swipe refresh when view is not at the top val firstPos = (recycler.layoutManager as LinearLayoutManager) .findFirstCompletelyVisibleItemPosition() - swipe_refresh.isEnabled = firstPos == 0 + swipe_refresh.isEnabled = firstPos <= 0 } }) diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt index 2ae2fba54..e54a24beb 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/recent_updates/RecentChaptersController.kt @@ -81,7 +81,7 @@ class RecentChaptersController : NucleusController(), recycler.scrollStateChanges().subscribeUntilDestroy { // Disable swipe refresh when view is not at the top val firstPos = layoutManager.findFirstCompletelyVisibleItemPosition() - swipe_refresh.isEnabled = firstPos == 0 + swipe_refresh.isEnabled = firstPos <= 0 } swipe_refresh.setDistanceToTriggerSync((2 * 64 * resources.displayMetrics.density).toInt()) diff --git a/app/src/test/java/eu/kanade/tachiyomi/TestApp.kt b/app/src/test/java/eu/kanade/tachiyomi/TestApp.kt index 35a74ceb2..cbac3701f 100644 --- a/app/src/test/java/eu/kanade/tachiyomi/TestApp.kt +++ b/app/src/test/java/eu/kanade/tachiyomi/TestApp.kt @@ -5,4 +5,8 @@ open class TestApp : App() { override fun setupAcra() { // Do nothing } + + override fun setupJobManager() { + // Do nothing + } }