Skip to content

Instantly share code, notes, and snippets.

@wisnukurniawan
Created January 14, 2018 00:50
Show Gist options
  • Select an option

  • Save wisnukurniawan/f830bb773d55431d8c0090abbc5ec516 to your computer and use it in GitHub Desktop.

Select an option

Save wisnukurniawan/f830bb773d55431d8c0090abbc5ec516 to your computer and use it in GitHub Desktop.
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