Created
August 12, 2019 16:50
-
-
Save yogacp/7edbeae78ad2f34d03f94dc745c68a5d 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) | |
} | |
interface OnLongClickListener { | |
fun onLongClick(v: View) | |
} | |
interface OnTouchListener { | |
fun onTouch(v: View, event: MotionEvent) | |
} | |
val button = findViewById<Button>(R.id.button) | |
button.setOnClickListener(object: OnClickListener{ | |
override fun onClick(v: View) { | |
// Now we only have one method to override | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment