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

Commit 88163da1 authored by Tianfan Zhang's avatar Tianfan Zhang
Browse files

Fix Cuebar ActionList animation direction bug in landscape 3-button

mode.

Bug: 427896460
Flag: com.android.systemui.enable_underlay
Test: Manual
Change-Id: Ifba55ed32f330a5ddcf90f3a5ad55b53469b37c5
parent 8f8445ce
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -90,6 +90,8 @@ fun ActionList(
    modifier: Modifier = Modifier,
    padding: PaddingValues = PaddingValues(0.dp),
    horizontalAlignment: Alignment.Horizontal = Alignment.CenterHorizontally,
    portrait: Boolean = true,
    pillCenter: Offset = Offset.Zero,
) {
    val density = LocalDensity.current
    val minOverscrollDelta = (-8).dp
@@ -326,6 +328,8 @@ fun ActionList(
                        columnSpacingPx * max((childHeights.size - index - 1f), 0f)
            }

            var chipWidthPx by remember { mutableIntStateOf(0) }

            Chip(
                action = action,
                modifier =
@@ -333,12 +337,20 @@ fun ActionList(
                            if (index < childHeights.size) {
                                childHeights[index] = it.height
                            }
                            chipWidthPx = it.width
                        }
                        .graphicsLayer {
                            if (portrait) {
                                translationY = (1f - translation) * appxColumnY
                                translationX = 0f
                            } else {
                                translationY = (1f - translation) * (appxColumnY - pillCenter.y)
                                translationX = (1f - translation) * chipWidthPx.toFloat()
                            }
                            scaleX = scale
                            scaleY = scale
                            transformOrigin = TransformOrigin(0.5f, 1f)
                            transformOrigin =
                                if (portrait) TransformOrigin(0.5f, 1f) else TransformOrigin(1f, 0f)
                        },
            )
        }
+2 −0
Original line number Diff line number Diff line
@@ -158,6 +158,8 @@ private fun TaskBarAnd3ButtonAmbientCue(
            } else {
                PaddingValues()
            },
        portrait = portrait,
        pillCenter = pillCenter,
    )
    ShortPill(
        actions = actions,