Created
February 5, 2019 10:35
-
-
Save azizkayumov/bdecdbd1080f904247e2c97f85d1e22c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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