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

Commit 1df5f38b authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Updated pill spec

Spring animation and better expand/collapse behavior

Bug: 403422950
Test: visual
Flag: com.android.systemui.enable_underlay
Change-Id: I9240d18ae20df0f911361c4524a4822dfcfdb3e1
parent fbab15d5
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
package com.android.systemui.ambientcue.ui.compose

import androidx.compose.animation.AnimatedVisibility
import androidx.compose.animation.core.Spring
import androidx.compose.animation.core.spring
import androidx.compose.animation.core.tween
import androidx.compose.animation.fadeIn
import androidx.compose.animation.fadeOut
@@ -40,14 +42,19 @@ fun ActionList(actions: List<ActionViewModel>, visible: Boolean, modifier: Modif
        horizontalAlignment = Alignment.CenterHorizontally,
    ) {
        actions.fastForEachIndexed { index, action ->
            val delay = 50 * (actions.size - index)
            val delay = 64 * (actions.size - index)
            AnimatedVisibility(
                visible = visible,
                enter =
                    slideInVertically(tween(450, delayMillis = delay)) {
                        with(density) { 15.dp.roundToPx() }
                    slideInVertically(
                        spring(
                            dampingRatio = Spring.DampingRatioMediumBouncy,
                            stiffness = Spring.StiffnessLow,
                        )
                    ) {
                        with(density) { 15.dp.roundToPx() * (actions.size - index) }
                    } + fadeIn(tween(450, delayMillis = delay)),
                exit = fadeOut(tween(250)),
                exit = fadeOut(tween(350, delayMillis = delay)),
            ) {
                Chip(action)
            }
+1 −1
Original line number Diff line number Diff line
@@ -56,7 +56,7 @@ fun AmbientCueContainer(
        )
        NavBarPill(
            actions = actions,
            navBarWidth = 90.dp, // TODO: b/414507396 - Replace with the width of the navbar
            navBarWidth = 110.dp, // TODO: b/414507396 - Replace with the width of the navbar
            visible = visible,
            expanded = expanded,
            modifier = Modifier.align(Alignment.BottomCenter),