mattinger
04/18/2025, 4:22 PMmattinger
04/18/2025, 4:22 PM@OptIn(ExperimentalMaterial3Api::class)
@Preview
@Composable
fun ScaffoldFocusTest() {
Scaffold(
topBar = {
TopAppBar(
title = { },
actions = {
IconButton(onClick = {}) {
Icon(imageVector = Icons.Default.Close, contentDescription = "Close")
}
}
)
}
) {
Column(modifier = Modifier.padding(it)) {
Text(
modifier = Modifier
.semantics {
heading()
}.focusable(true),
text = "Heading",
style = MaterialTheme.typography.headlineLarge
)
}
}
val focusManager = LocalFocusManager.current
LaunchedEffect(true) {
delay(1000L)
focusManager.moveFocus(FocusDirection.Down)
}
}