Lauren Yew
09/07/2021, 9:42 PMTopAppBar
? I'm trying to make it auto focus on the title
rather than the navigationIcon
, but none of the focus methods are working. I've tried setting focusOrder
, focusRequester
, using DisposableEffect
to requestFocus. Nothing is working. Talkback always wants to focus first on the navigation icon of the back button. I have a design request to focus on the title THEN the back button.nitrog42
09/07/2021, 9:56 PMLauren Yew
09/07/2021, 9:57 PMLauren Yew
09/07/2021, 9:57 PMnitrog42
09/07/2021, 10:29 PMnitrog42
09/07/2021, 10:34 PMvar hideBack by remember { mutableStateOf(true) }
LaunchedEffect(true) {
delay(1_000L)
hideBack = false
}
TopAppBar(title = {
Text(
"title", modifier = Modifier
.focusable()
)
}, navigationIcon = {
IconButton(
onClick = { }, modifier = Modifier.run {
if (hideBack) {
clearAndSetSemantics { }
} else {
this
}
}) {
Icon(Icons.Default.ArrowBack, null)
}
})
I think it does what you want ? I really hope somebody as a better answer 😄Lauren Yew
09/07/2021, 10:35 PMnitrog42
09/07/2021, 10:41 PMnitrog42
09/07/2021, 10:42 PMLauren Yew
09/07/2021, 10:44 PM