Skip to content

Instantly share code, notes, and snippets.

@Lamartio
Created September 24, 2018 08:16
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/492d57214733a3156ae3a9aa0d841ec6 to your computer and use it in GitHub Desktop.
Save Lamartio/492d57214733a3156ae3a9aa0d841ec6 to your computer and use it in GitHub Desktop.
MainActivity.kt
class MainActivity : AppCompatActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(LinearLayout(this).layout(User.observable) {
layout.orientation = LinearLayout.VERTICAL
layout.gravity = Gravity.CENTER
+textView {
bind { text = "$name: $age" }
}
// ...
})
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment