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

Commit ead7ef80 authored by Alejandro Nijamkin's avatar Alejandro Nijamkin Committed by Ale Nijamkin
Browse files

[flexiglass] Bouncer scene UX polish.

As per UX, aligns the top of the user switcher and the top of the
bouncer UI with each other. This is only for the tablet side-by-side layout.

Note that it still doesn't look perfectly aligned because the
placeholder user icon has built-in visual padding in the actual
drawable; but it's better than before.

Bug: 300677757
Test: before - https://screenshot.googleplex.com/3qc5qunWKA3okhA
Test: after - https://screenshot.googleplex.com/7eWytuPG6NKVUdV
Flag: NA
Change-Id: Iabe668511245a81acad3c9e2c7cf036825008c2c
parent 0d341f29
Loading
Loading
Loading
Loading
+17 −21
Original line number Diff line number Diff line
@@ -33,7 +33,6 @@ import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.BoxScope
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxHeight
@@ -311,15 +310,21 @@ private fun BesideUserSwitcherLayout(

    Row(
        modifier =
            modifier.pointerInput(Unit) {
            modifier
                .pointerInput(Unit) {
                    detectTapGestures(
                        onDoubleTap = { offset ->
                        // Depending on where the user double tapped, switch the elements such that
                        // the endContent is closer to the side that was double tapped.
                            // Depending on where the user double tapped, switch the elements such
                            // that the non-swapped element is closer to the side that was double
                            // tapped.
                            setSwapped(offset.x < size.width / 2)
                        }
                    )
            },
                }
                .padding(
                    top = if (isHeightExpanded) 128.dp else 96.dp,
                    bottom = if (isHeightExpanded) 128.dp else 48.dp,
                ),
    ) {
        val animatedOffset by
            animateFloatAsState(
@@ -359,20 +364,11 @@ private fun BesideUserSwitcherLayout(

        UserSwitcher(
            viewModel = viewModel,
            modifier = Modifier.weight(1f).align(Alignment.CenterVertically).swappable(),
            modifier = Modifier.weight(1f).swappable(),
        )

        FoldAware(
            modifier =
                Modifier.weight(1f)
                    .padding(
                        if (isHeightExpanded) {
                            PaddingValues(vertical = 128.dp)
                        } else {
                            PaddingValues(top = 94.dp, bottom = 48.dp)
                        }
                    )
                    .swappable(inversed = true),
            modifier = Modifier.weight(1f).swappable(inversed = true),
            viewModel = viewModel,
            aboveFold = {
                Column(