Skip to content

Instantly share code, notes, and snippets.

@theerasan
Last active October 5, 2017 18:53
Show Gist options
  • Save theerasan/0ddc23286515283c4454363045f78453 to your computer and use it in GitHub Desktop.
Save theerasan/0ddc23286515283c4454363045f78453 to your computer and use it in GitHub Desktop.
// ViewExtension
fun View.setOnAnimateClickListener(onClick: (View) -> Unit) {
this.setOnAnimateClickListener(null, onClick)
}
// MainActivity
val applyButton = findViewById(R.id.applyButton)
applyButton.setOnAnimateClickListener({view ->
Toast.makeText(this, "Clicked Apply " + view.id , Toast.LENGTH_SHORT).show()
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment