Created
September 13, 2019 17:07
-
-
Save andreikastsiuk/d9fe23e0bfb44e0c70171da97db89e69 to your computer and use it in GitHub Desktop.
Useful extension function to bind views
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
fun <T : View> Activity.bindView(@IdRes idRes: Int): Lazy<T> { | |
return lazyUnsychronized { | |
findViewById<T>(idRes) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment