Created
February 9, 2021 12:17
-
-
Save robertlevonyan/e7aa4f5b99da403caad7be68d49f1201 to your computer and use it in GitHub Desktop.
drop item into recyclerview
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class DropListener(private val onDrop: () -> Unit) : View.OnDragListener { | |
override fun onDrag(view: View, dragEvent: DragEvent): Boolean { | |
when (dragEvent.action) { | |
// when item has been dropped, notify about it | |
DragEvent.ACTION_DROP -> onDrop() | |
} | |
return true | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment