Fix library category not updatable when empty. Closes #907

pull/919/head
inorichi 7 years ago
parent aa46c52eee
commit 6059b85e58

@ -83,7 +83,7 @@ class LibraryCategoryView @JvmOverloads constructor(context: Context, attrs: Att
// Disable swipe refresh when view is not at the top // Disable swipe refresh when view is not at the top
val firstPos = (recycler.layoutManager as LinearLayoutManager) val firstPos = (recycler.layoutManager as LinearLayoutManager)
.findFirstCompletelyVisibleItemPosition() .findFirstCompletelyVisibleItemPosition()
swipe_refresh.isEnabled = firstPos == 0 swipe_refresh.isEnabled = firstPos <= 0
} }
}) })

@ -81,7 +81,7 @@ class RecentChaptersController : NucleusController<RecentChaptersPresenter>(),
recycler.scrollStateChanges().subscribeUntilDestroy { recycler.scrollStateChanges().subscribeUntilDestroy {
// Disable swipe refresh when view is not at the top // Disable swipe refresh when view is not at the top
val firstPos = layoutManager.findFirstCompletelyVisibleItemPosition() val firstPos = layoutManager.findFirstCompletelyVisibleItemPosition()
swipe_refresh.isEnabled = firstPos == 0 swipe_refresh.isEnabled = firstPos <= 0
} }
swipe_refresh.setDistanceToTriggerSync((2 * 64 * resources.displayMetrics.density).toInt()) swipe_refresh.setDistanceToTriggerSync((2 * 64 * resources.displayMetrics.density).toInt())

@ -5,4 +5,8 @@ open class TestApp : App() {
override fun setupAcra() { override fun setupAcra() {
// Do nothing // Do nothing
} }
override fun setupJobManager() {
// Do nothing
}
} }

Loading…
Cancel
Save