summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chandru S <chandruis@google.com> 2024-05-29 17:53:02 -0700
committer Chandru S <chandruis@google.com> 2024-06-04 13:45:04 -0700
commit69d2f4d8c2aaa179ddf771f87fdb105201e18fd0 (patch)
tree64b7484bd88eb493d4ead539d535fa1dfad8568c
parent941e4e94f235a6d660e5a3dda0c8c12efba02c51 (diff)
Make Pin bouncer buttons focusable
Fixes: 338969289 Test: open PIN bouncer run adb shell input text "PIN digits" run adb shell input keyevent ENTER run adb shell input keyevent DEL verify expected events happen. Flag: com.android.systemui.scene_container Change-Id: I3b72732159a110acfde45f4c24211d4a71a90d52
-rw-r--r--packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
index 64ace2f18372..54f396989161 100644
--- a/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
+++ b/packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/PinBouncer.kt
@@ -24,6 +24,7 @@ import androidx.compose.animation.core.AnimationVector1D
import androidx.compose.animation.core.animateDpAsState
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
+import androidx.compose.foundation.focusable
import androidx.compose.foundation.gestures.detectTapGestures
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.aspectRatio
@@ -41,6 +42,8 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.drawBehind
+import androidx.compose.ui.focus.FocusRequester
+import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.geometry.CornerRadius
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
@@ -284,6 +287,8 @@ private fun PinPadButton(
contentAlignment = Alignment.Center,
modifier =
modifier
+ .focusRequester(FocusRequester.Default)
+ .focusable()
.sizeIn(maxWidth = pinButtonMaxSize, maxHeight = pinButtonMaxSize)
.aspectRatio(1f)
.drawBehind {