Slide 26
Slide 26 text
Sample screen (Compose-based)
26
@Composable
fun ComposeScreen() {
var counter by remember { mutableIntStateOf(0) }
Box(modifier = Modifier.fillMaxSize().padding(16.dp)) {
Text("ComposeActivity", modifier =
Modifier.align(Alignment.TopStart))
Column(
modifier = Modifier.align(Alignment.Center),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally,
) {
Text("count: $counter")
Spacer(modifier = Modifier.height(16.dp))
Button(onClick = { counter++ }) {
Text("count up")
}
}
}