Skip to content

Commit

Permalink
Various kotlin fix
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenVinouze committed Jun 20, 2017
1 parent 54b8cf1 commit d51007c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {

Expand All @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,9 @@ fun <T> RecyclerAdapter<T>.setItems(items: MutableList<T>, 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
Expand Down

0 comments on commit d51007c

Please sign in to comment.