Created
January 14, 2018 00:50
-
-
Save wisnukurniawan/f830bb773d55431d8c0090abbc5ec516 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| linearLayout { | |
| orientation = LinearLayout.VERTICAL | |
| val myEdt = editText { | |
| hint = "Name" | |
| }.lparams(width = matchParent, height = wrapContent) | |
| button("Say Hello") { | |
| onClick { | |
| val message = if (myEdt.text.toString().isBlank()) { | |
| "Hello world" | |
| } else { | |
| "Hello ${myEdt.text}" | |
| } | |
| UI { | |
| toast(message) | |
| } | |
| } | |
| }.lparams(width = matchParent, height = wrapContent) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment