Skip to content

Commit

Permalink
method name change
Browse files Browse the repository at this point in the history
  • Loading branch information
pknotfound committed Oct 24, 2020
1 parent 5b3ac91 commit 94fc18d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ object DragAndDrop: View.OnTouchListener, GestureDetector.OnGestureListener {

private lateinit var holder: RecyclerView.ViewHolder

fun RecyclerView.addDragToSwipe(listener: onDragged? = null): ItemTouchHelper {
fun RecyclerView.addDragToShift(listener: onDragged? = null): ItemTouchHelper {

val itemTouchCallback = object : ItemTouchHelper.Callback() {
override fun onSelectedChanged(viewHolder: RecyclerView.ViewHolder?, actionState: Int) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
package com.kedia.customswipelibrary

import android.os.Bundle
import android.util.Log
import androidx.appcompat.app.AppCompatActivity
import androidx.core.content.ContextCompat
import androidx.recyclerview.widget.LinearLayoutManager
import com.kedia.swipetodelete.DragAndDrop
import com.kedia.swipetodelete.DragAndDrop.addDragToSwipe
import com.kedia.swipetodelete.DragAndDrop.addDragToShift
import com.kedia.swipetodelete.SwipeToDelete
import com.kedia.swipetodelete.SwipeToDelete.addSwipeToDelete
import kotlinx.android.synthetic.main.activity_main.*
Expand All @@ -29,7 +27,7 @@ class MainActivity : AppCompatActivity(), SwipeToDelete.OnSwiped {
adapter = this@MainActivity.adapter
}

recycler.addDragToSwipe()
recycler.addDragToShift()

val list = listOf(SwipeToDelete.DIRECTION.LEFT,
SwipeToDelete.DIRECTION.RIGHT)
Expand Down

0 comments on commit 94fc18d

Please sign in to comment.