Skip to content

Instantly share code, notes, and snippets.

@Atsumi3
Created December 13, 2018 07:25
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 Atsumi3/d79f1bc3dad2f7e340ef1f280c82cf0c to your computer and use it in GitHub Desktop.
Save Atsumi3/d79f1bc3dad2f7e340ef1f280c82cf0c to your computer and use it in GitHub Desktop.
Create instance from KClass<out View>, with constructor parameters.
fun KClass<out View>.get(context: Context): View? = primaryConstructor?.call(context)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment