Crash fix

This commit is contained in:
len 2016-10-09 11:10:47 +02:00
parent 876831480a
commit 6cf84256fe

View File

@ -85,9 +85,9 @@ class WebtoonReader : BaseReader() {
recycler.adapter = adapter
recycler.addOnScrollListener(object : RecyclerView.OnScrollListener() {
override fun onScrolled(recyclerView: RecyclerView?, dx: Int, dy: Int) {
val page = layoutManager.findLastVisibleItemPosition()
if (page != currentPage) {
onPageChanged(page)
val index = layoutManager.findLastVisibleItemPosition()
if (index != currentPage) {
pages.getOrNull(index)?.let { onPageChanged(index) }
}
}
})