Skip to content

Instantly share code, notes, and snippets.

@andreikastsiuk
Created September 13, 2019 17:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andreikastsiuk/d9fe23e0bfb44e0c70171da97db89e69 to your computer and use it in GitHub Desktop.
Save andreikastsiuk/d9fe23e0bfb44e0c70171da97db89e69 to your computer and use it in GitHub Desktop.
Useful extension function to bind views
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