Android’s modern toolkit for building native UI
To show a text in compose ui just write
Text("Hello! Compose Ui")
To add style in text
Text(text = "Hello! Compose Ui",
style = +themeTextStyle { h6 }
)
To use color as background
Surface(color = Color.Yellow) {
}
Shows child view vertically
Column {
Greeting("Hello!")
Greeting("Compose Ui")
}
Shows child view horizontally
Row {
Greeting("Hello!")
Greeting("Compose Ui")
}
To show a simple list
Column {
listOf("John", "Julia", "Alice", "Mark").forEach {
Text("Hello $it")
}
}
We can add divider and some spacing to make this list better.
Column {
listOf("John", "Julia", "Alice", "Mark").forEach {
Padding(padding = 16.dp) {
Text("Hello $it")
}
Divider()
}
}