Skip to content

Instantly share code, notes, and snippets.

@vontell
Created January 30, 2018 19:06
Show Gist options
  • Save vontell/24b89ab7521d72e6a64eedaf2914cfb0 to your computer and use it in GitHub Desktop.
Save vontell/24b89ab7521d72e6a64eedaf2914cfb0 to your computer and use it in GitHub Desktop.
002 Setting Remove Listeners
// Set the remove listener using a lambda function
customChip.setOnRemoveListener({
Toast.makeText(this, "Remove chip clicked", Toast.LENGTH_SHORT).show()
})
// Set the remove listener using an anonymous interface
customChipThree.setOnRemoveListener(object: ChipView.OnChipRemovedListener {
override fun onRemove(v: View) {
Toast.makeText(baseContext, "Remove chip clicked", Toast.LENGTH_SHORT).show()
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment