Created
February 9, 2021 12:20
-
-
Save robertlevonyan/5cc45ef5b274c5d975300121c6512ae8 to your computer and use it in GitHub Desktop.
setting the drop listener
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
// binding is a viewBinding instance | |
binding.rvSentence.setOnDragListener( | |
DropListener { | |
wordsAdapter.removeItem(selectedWord) // remove dropped word from word box | |
sentenceAdapter.addItem(selectedWord) // add dropped word to sentence | |
} | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment