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

Commit 00bd17d1 authored by burakov's avatar burakov Committed by Danny Burakov
Browse files

[flexiglass] Make the Bouncer bottom padding resize to available space.

The Emergency Action Button was being squished because of the high
bottom padding (48dp) required of it even when the IME is open. By
changing 16dp of that padding to collapse to zero when there isn't
sufficient vertical space, we're avoiding that problem.

This also reduces some of the padding between the emergency button and
the input field, such that the paddings around the button are more
visually balanced in that scenario.

Fix: 436813358
Test: Manually tested the password bouncer on an unfolded device.
Flag: com.android.systemui.scene_container
Change-Id: Ib6e0f43d76c612c49b865f6fdb890f62f0139503
parent de518842
Loading
Loading
Loading
Loading
+11 −3
Original line number Diff line number Diff line
@@ -238,7 +238,7 @@ fun ContentScope.BouncerContent(

@Composable
@VisibleForTesting
fun ContentScope.BouncerContent(
fun BouncerContent(
    layout: BouncerOverlayLayout,
    viewModel: BouncerOverlayContentViewModel,
    dialogFactory: BouncerDialogFactory,
@@ -297,7 +297,7 @@ private fun StandardLayout(
        LocalWindowSizeClass.current.heightSizeClass == WindowHeightSizeClass.Expanded

    FoldAware(
        modifier = modifier.padding(top = 92.dp, bottom = 48.dp),
        modifier = modifier.padding(top = 92.dp, bottom = 32.dp),
        viewModel = viewModel,
        aboveFold = {
            Column(
@@ -326,7 +326,15 @@ private fun StandardLayout(
                    )
                }

                ActionArea(viewModel = viewModel, modifier = Modifier.padding(top = 48.dp))
                Column(
                    horizontalAlignment = Alignment.CenterHorizontally,
                    modifier = Modifier.fillMaxWidth(),
                ) {
                    ActionArea(viewModel = viewModel, modifier = Modifier.padding(top = 32.dp))
                    // This spacer dynamically resizes to 0 when there is insufficient space
                    // available, e.g. when the IME is shown.
                    Spacer(modifier = Modifier.weight(1f, fill = false).height(16.dp))
                }
            }
        },
    )