android: make settings button focusable and clickable (#484)

Fixes tailscale/corp#22717

Signed-off-by: kari-ts <kari@tailscale.com>
pull/486/head^2
kari-ts 3 months ago committed by GitHub
parent eae8789628
commit d94125e767
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -187,22 +187,28 @@ fun MainView(
} }
}, },
trailingContent = { trailingContent = {
Box(modifier = Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) { Box(
when (user) { modifier =
null -> SettingsButton { navigation.onNavigateToSettings() } Modifier.weight(1f)
else -> .focusable()
Box( .clickable { navigation.onNavigateToSettings() }
contentAlignment = Alignment.Center, .padding(8.dp),
modifier = contentAlignment = Alignment.CenterEnd) {
Modifier.size(42.dp).clip(CircleShape).clickable { when (user) {
navigation.onNavigateToSettings() null -> SettingsButton { navigation.onNavigateToSettings() }
}) { else ->
Avatar(profile = user, size = 36) { Box(
navigation.onNavigateToSettings() contentAlignment = Alignment.Center,
} modifier =
} Modifier.size(42.dp).clip(CircleShape).focusable().clickable {
} navigation.onNavigateToSettings()
} }) {
Avatar(profile = user, size = 36) {
navigation.onNavigateToSettings()
}
}
}
}
}) })
when (state) { when (state) {

Loading…
Cancel
Save