Fix scroll to bottom

This commit is contained in:
Moez Bhatti
2018-04-21 16:28:38 -04:00
parent afd37a2a7a
commit c1cdb1e7b1
2 changed files with 1 additions and 5 deletions
@@ -31,7 +31,7 @@ fun RecyclerView.Adapter<*>.autoScrollToStart(recyclerView: RecyclerView) {
notifyItemChanged(positionStart - 1)
}
val lastPosition = layoutManager.findLastCompletelyVisibleItemPosition()
val lastPosition = layoutManager.findLastVisibleItemPosition()
if (positionStart >= getItemCount() - 1 && lastPosition == positionStart - 1) {
recyclerView.scrollToPosition(positionStart)
}