Created
August 12, 2019 16:43
-
-
Save yogacp/8196aabdbfe898ddcc09e083a518f41a to your computer and use it in GitHub Desktop.
This file contains hidden or 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
interface OnClickListener { | |
fun onClick(v: View) | |
fun onLongClick(v: View) | |
fun onTouch(v: View, event: MotionEvent) | |
} | |
val button = findViewById<Button>(R.id.button) | |
button.setOnClickListener(object: OnClickListener{ | |
override fun onClick(v: View) { | |
// Want to do some magic here | |
} | |
override fun onLongClick(v: View) { | |
// No need this function | |
} | |
override fun onTouch(v: View, event: MotionEvent) { | |
// No need this function | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment