Last active
August 29, 2015 14:05
-
-
Save longliveenduro/6fd1a1109f1e3d946231 to your computer and use it in GitHub Desktop.
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
implicit class RichView[V <: android.view.View](view: V) { | |
def onClick[U](f: android.view.View => U): V = { | |
view.setOnClickListener(new android.view.View.OnClickListener { | |
def onClick(p: android.view.View): Unit = f(p) | |
}) | |
view | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment