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

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

Merge "Add content description to OOBE tutorial animation." into main

parents de6e17da f0ee9f1e
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -3949,6 +3949,8 @@
    <string name="tutorial_action_key_success_title">Well done!</string>
    <!-- Text shown to the user after they complete action key tutorial [CHAR LIMIT=NONE] -->
    <string name="tutorial_action_key_success_body">You completed the view all apps gesture</string>
    <!-- Content description for the animation playing during the tutorial. The user can click the animation to pause and unpause playback. [CHAR LIMIT=NONE] -->
    <string name="tutorial_animation_content_description">Tutorial animation, click to pause and resume play.</string>

    <!-- Content description for keyboard backlight brightness dialog [CHAR LIMIT=NONE] -->
    <string name="keyboard_backlight_dialog_title">Keyboard backlight</string>
+9 −1
Original line number Diff line number Diff line
@@ -36,6 +36,9 @@ import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.node.Ref
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.util.lerp
import com.airbnb.lottie.LottieComposition
import com.airbnb.lottie.compose.LottieAnimation
@@ -47,6 +50,7 @@ import com.airbnb.lottie.compose.rememberLottieComposition
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.Finished
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.InProgress
import com.android.systemui.inputdevice.tutorial.ui.composable.TutorialActionState.NotStarted
import com.android.systemui.res.R

@Composable
fun TutorialAnimation(
@@ -104,11 +108,15 @@ private fun EducationAnimation(
            isPlaying = isPlaying,
            restartOnPlay = false,
        )
    val animationDescription = stringResource(R.string.tutorial_animation_content_description)
    LottieAnimation(
        composition = composition,
        progress = { progress },
        dynamicProperties = animationProperties,
        modifier = Modifier.fillMaxSize().clickable { isPlaying = !isPlaying },
        modifier =
            Modifier.fillMaxSize()
                .clickable { isPlaying = !isPlaying }
                .semantics { contentDescription = animationDescription },
    )
}