Skip to content

Instantly share code, notes, and snippets.

@Lamartio
Created September 10, 2018 12:08
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 Lamartio/97be461ec8d4bb176e3f99706db49c7e to your computer and use it in GitHub Desktop.
Save Lamartio/97be461ec8d4bb176e3f99706db49c7e to your computer and use it in GitHub Desktop.
LinearLayout(this) layout {
// ...
}
infix fun <V : ViewGroup> V.layout(block: Layout<V>.() -> Unit): V =
also { Layout(it).run(block) }
class Layout<V : ViewGroup>(val layout: V) : ViewManager by layout, ViewParent by layout {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment