android4-9 Exercise 1: XML to Compose ================================== // The same screen in Compose @Composable fun MainScreen(onOpen: () -> Unit) { Column(modifier = Modifier.fillMaxSize().padding(16.dp)) { Text(stringResource(R.string.greeting_title)) Button(onClick = onOpen) { Text(stringResource(R.string.open_details)) } } } Attributes with no direct counterpart: - android:id and @+id: Compose has no ids to look views up by; the state you pass in is the source of truth. - layout_width / layout_height (required in XML): Compose composables wrap their content by default; ask for more with modifiers (fillMaxSize, fillMaxWidth). - android:orientation: replaced by choosing Column or Row. - xmlns:android: XML namespace boilerplate; not needed in Kotlin. (general knowledge; code unrun)