Fix library category not updatable when empty. Closes #907

This commit is contained in:
inorichi
2017-07-27 09:21:15 +02:00
parent aa46c52eee
commit 6059b85e58
3 changed files with 6 additions and 2 deletions

View File

@ -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
}
})

View File

@ -81,7 +81,7 @@ class RecentChaptersController : NucleusController<RecentChaptersPresenter>(),
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())