Skip to content

Instantly share code, notes, and snippets.

@WendyYanto
Last active December 13, 2020 11:41
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 WendyYanto/2b564519f3b7d1324a0b6bd32fbb02f9 to your computer and use it in GitHub Desktop.
Save WendyYanto/2b564519f3b7d1324a0b6bd32fbb02f9 to your computer and use it in GitHub Desktop.
class LazyLoadComponent @JvmOverloads constructor(
context: Context, attrs: AttributeSet? = null
) : LinearLayout(context, attrs) {
private val viewStub by lazy {
ViewStub(context, attrs)
}
init {
with(viewStub) {
addView(this)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment