Skip to content

Commit d94125e

Browse files
authored
android: make settings button focusable and clickable (#484)
Fixes tailscale/corp#22717 Signed-off-by: kari-ts <[email protected]>
1 parent eae8789 commit d94125e

File tree

1 file changed

+22
-16
lines changed
  • android/src/main/java/com/tailscale/ipn/ui/view

1 file changed

+22
-16
lines changed

android/src/main/java/com/tailscale/ipn/ui/view/MainView.kt

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -187,22 +187,28 @@ fun MainView(
187187
}
188188
},
189189
trailingContent = {
190-
Box(modifier = Modifier.weight(1f), contentAlignment = Alignment.CenterEnd) {
191-
when (user) {
192-
null -> SettingsButton { navigation.onNavigateToSettings() }
193-
else ->
194-
Box(
195-
contentAlignment = Alignment.Center,
196-
modifier =
197-
Modifier.size(42.dp).clip(CircleShape).clickable {
198-
navigation.onNavigateToSettings()
199-
}) {
200-
Avatar(profile = user, size = 36) {
201-
navigation.onNavigateToSettings()
202-
}
203-
}
204-
}
205-
}
190+
Box(
191+
modifier =
192+
Modifier.weight(1f)
193+
.focusable()
194+
.clickable { navigation.onNavigateToSettings() }
195+
.padding(8.dp),
196+
contentAlignment = Alignment.CenterEnd) {
197+
when (user) {
198+
null -> SettingsButton { navigation.onNavigateToSettings() }
199+
else ->
200+
Box(
201+
contentAlignment = Alignment.Center,
202+
modifier =
203+
Modifier.size(42.dp).clip(CircleShape).focusable().clickable {
204+
navigation.onNavigateToSettings()
205+
}) {
206+
Avatar(profile = user, size = 36) {
207+
navigation.onNavigateToSettings()
208+
}
209+
}
210+
}
211+
}
206212
})
207213

208214
when (state) {

0 commit comments

Comments
 (0)