Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab36f22c authored by Josh's avatar Josh Committed by Joshua Mokut
Browse files

Focus states for keyboard settings button in shortcut helper

+ adjusted paddings for keyboard settings button to avoid focus states
  clipping

Bug: 352305030
Test: Manual - open shortcut helper, using tab + arrow keys navigate to
keyboard settings at the bottom of the left panel, ensure the focus
outline appears around the keyboard settings button.
Flag: com.android.systemui.keyboard_shortcut_helper_rewrite

Change-Id: I57f16d234aa02753789d228289d921e9fa232531
parent 4d147a8b
Loading
Loading
Loading
Loading
+17 −3
Original line number Diff line number Diff line
@@ -806,14 +806,27 @@ private fun ShortcutsSearchBar(onQueryChange: (String) -> Unit) {

@Composable
private fun KeyboardSettings(onClick: () -> Unit) {
    val interactionSource = remember { MutableInteractionSource() }
    val isFocused by interactionSource.collectIsFocusedAsState()

    Surface(
        onClick = onClick,
        shape = RoundedCornerShape(24.dp),
        color = Color.Transparent,
        modifier = Modifier.semantics { role = Role.Button }.fillMaxWidth()
        modifier =
            Modifier.semantics { role = Role.Button }
                .fillMaxWidth()
                .focusable(interactionSource = interactionSource)
    ) {
        Row(
            modifier = Modifier.padding(horizontal = 24.dp, vertical = 16.dp),
            modifier =
                Modifier.padding(horizontal = 12.dp, vertical = 16.dp)
                    .outlineFocusModifier(
                        isFocused = isFocused,
                        focusColor = MaterialTheme.colorScheme.secondary,
                        padding = 8.dp,
                        cornerRadius = 28.dp
                    ),
            verticalAlignment = Alignment.CenterVertically
        ) {
            Text(
@@ -825,7 +838,8 @@ private fun KeyboardSettings(onClick: () -> Unit) {
            Icon(
                imageVector = Icons.AutoMirrored.Default.OpenInNew,
                contentDescription = null,
                tint = MaterialTheme.colorScheme.onSurfaceVariant
                tint = MaterialTheme.colorScheme.onSurfaceVariant,
                modifier = Modifier.size(24.dp)
            )
        }
    }