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

Commit ad46d5b7 authored by Michal Brzezinski's avatar Michal Brzezinski
Browse files

Adding on success animation in touchpad tutorial

Switching to another lottie animation when gesture is done successfully.
Also updating basic animation with minor improvements (no background color, fixed arrow color).

Bug: 346579074
Test: Open back gesture screen, do back gesture and see success animation playing once
Flag: com.android.systemui.shared.new_touchpad_gestures_tutorial
Change-Id: I8a60ee037b58fee02b32b21ca3c85e62ebec4802
parent e78e520d
Loading
Loading
Loading
Loading
+1 −1

File changed.

Preview size limit exceeded, changes collapsed.

+1 −0

File added.

Preview size limit exceeded, changes collapsed.

+9 −4
Original line number Diff line number Diff line
@@ -142,6 +142,7 @@ private fun GestureTutorialContent(
            )
            Spacer(modifier = Modifier.width(76.dp))
            TutorialAnimation(
                gestureDone,
                screenColors.animationProperties,
                modifier = Modifier.weight(1f).padding(top = 8.dp)
            )
@@ -173,14 +174,18 @@ fun TutorialDescription(
}

@Composable
fun TutorialAnimation(animationProperties: LottieDynamicProperties, modifier: Modifier = Modifier) {
fun TutorialAnimation(
    gestureDone: Boolean,
    animationProperties: LottieDynamicProperties,
    modifier: Modifier = Modifier
) {
    Column(modifier = modifier.fillMaxWidth()) {
        val composition by
            rememberLottieComposition(LottieCompositionSpec.RawRes(R.raw.trackpad_back_edu))
        val resId = if (gestureDone) R.raw.trackpad_back_success else R.raw.trackpad_back_edu
        val composition by rememberLottieComposition(LottieCompositionSpec.RawRes(resId))
        val progress by
            animateLottieCompositionAsState(
                composition,
                iterations = LottieConstants.IterateForever
                iterations = if (gestureDone) 1 else LottieConstants.IterateForever
            )
        LottieAnimation(
            composition = composition,