diff --git a/gesture/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_gesture/extensions/Gesture.kt b/gesture/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_gesture/extensions/Gesture.kt index 8de9002..b45f003 100644 --- a/gesture/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_gesture/extensions/Gesture.kt +++ b/gesture/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_gesture/extensions/Gesture.kt @@ -43,8 +43,8 @@ fun RecyclerView.handleGesture(dragGestures: Int, swipeGestures: Int, callback: } override fun onMove(recyclerView: RecyclerView?, viewHolder: RecyclerView.ViewHolder?, target: RecyclerView.ViewHolder?): Boolean { - var fromPosition = viewHolder!!.layoutPosition - var toPosition = target!!.layoutPosition + val fromPosition = viewHolder!!.layoutPosition + val toPosition = target!!.layoutPosition val adapter = adapter as? RecyclerAdapter<*> if (adapter != null) { @@ -65,7 +65,7 @@ fun RecyclerView.handleGesture(dragGestures: Int, swipeGestures: Int, callback: } override fun onSwiped(viewHolder: RecyclerView.ViewHolder?, direction: Int) { - var position = viewHolder!!.layoutPosition + val position = viewHolder!!.layoutPosition val adapter = adapter as? RecyclerAdapter<*> if (adapter != null) { adapter.removeItem(position) diff --git a/pagination/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_pagination/extensions/Pagination.kt b/pagination/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_pagination/extensions/Pagination.kt index 18828f6..f2bffd4 100644 --- a/pagination/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_pagination/extensions/Pagination.kt +++ b/pagination/src/main/kotlin/com/github/stephenvinouze/advancedrecyclerview_pagination/extensions/Pagination.kt @@ -69,9 +69,9 @@ fun RecyclerAdapter.setItems(items: MutableList, page: Int) { */ private fun paginationTrigger(totalItemCount: Int): Int { var offset = 0.6f - if (totalItemCount > 50 && totalItemCount <= 100) { + if (totalItemCount in 51..100) { offset = 0.7f - } else if (totalItemCount > 100 && totalItemCount <= 150) { + } else if (totalItemCount in 101..150) { offset = 0.8f } else if (totalItemCount > 150) { offset = 0.9f