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

Commit fb8adfb7 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Set default focus for a11y in oobe tutorial screen." into main

parents 5755c77f bc29c821
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.res.Configuration
import androidx.annotation.RawRes
import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.foundation.background
import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
@@ -33,8 +34,12 @@ import androidx.compose.foundation.layout.width
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.focus.FocusRequester
import androidx.compose.ui.focus.focusRequester
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.graphicsLayer
import androidx.compose.ui.platform.LocalConfiguration
@@ -125,6 +130,8 @@ fun TutorialDescription(
    config: TutorialScreenConfig,
    modifier: Modifier = Modifier,
) {
    val focusRequester = remember { FocusRequester() }
    LaunchedEffect(Unit) { focusRequester.requestFocus() }
    val (titleTextId, bodyTextId) =
        if (actionState is Finished) {
            config.strings.titleSuccessResId to config.strings.bodySuccessResId
@@ -136,6 +143,7 @@ fun TutorialDescription(
            text = stringResource(id = titleTextId),
            style = MaterialTheme.typography.displayLarge,
            color = config.colors.title,
            modifier = Modifier.focusRequester(focusRequester).focusable(),
        )
        Spacer(modifier = Modifier.height(16.dp))
        Text(