Skip to content

Instantly share code, notes, and snippets.

@azizkayumov
Created February 5, 2019 10:35
Show Gist options
  • Save azizkayumov/bdecdbd1080f904247e2c97f85d1e22c to your computer and use it in GitHub Desktop.
Save azizkayumov/bdecdbd1080f904247e2c97f85d1e22c to your computer and use it in GitHub Desktop.
class MessageUI(val flags: Int = 0) : AnkoComponent<ViewGroup> {
override fun createView(ui: AnkoContext<ViewGroup>): View = with(ui) {
linearLayout {
layoutParams = LinearLayout.LayoutParams(matchParent, wrapContent)
if (flags && 8 >= 1) {
textView {
layoutParams = LinearLayout.LayoutParams(matchParent, dip(56))
text = "Contact message"
}
}
// add other views
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment