January 2018
Intermediate to advanced
434 pages
14h 1m
English
Let's start with a simple example where we use Anko to create a layout for our target activity (the activity in which you want to create a layout):
override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) verticalLayout { padding = dip(20) val name = editText { hint = "What is your name?" } val message = editText { hint = "Your message" } button("Send") { onClick { toast("Hello, ${name.text} we have recorded your message!") } } }}
Read now
Unlock full access