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

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

Define separate horizontal margins for Dual Shade.

Bug: 338033836
Flag: com.android.systemui.scene_container
Test: Verified manually by observing the shade and notifications
 placement.
Change-Id: Iafa40e1b922d07f5ddf1d08f392e9dff3a68a9b7
parent b84b3a48
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -121,14 +121,15 @@ private fun Modifier.panelPadding(): Modifier {
    val systemBars = WindowInsets.systemBarsIgnoringVisibility
    val displayCutout = WindowInsets.displayCutout
    val waterfall = WindowInsets.waterfall
    val contentPadding = PaddingValues(all = OverlayShade.Dimensions.ScrimContentPadding)
    val horizontalPadding =
        PaddingValues(horizontal = dimensionResource(id = R.dimen.shade_panel_margin_horizontal))

    val combinedPadding =
        combinePaddings(
            systemBars.asPaddingValues(),
            displayCutout.asPaddingValues(),
            waterfall.asPaddingValues(),
            contentPadding,
            horizontalPadding,
        )

    return if (widthSizeClass == WindowWidthSizeClass.Compact) {
@@ -174,7 +175,6 @@ object OverlayShade {
    }

    object Dimensions {
        val ScrimContentPadding = 16.dp
        val PanelCornerRadius = 46.dp
        val OverscrollLimit = 32.dp
    }
+8 −0
Original line number Diff line number Diff line
@@ -76,6 +76,14 @@
    <dimen name="large_dialog_width">472dp</dimen>

    <dimen name="large_screen_shade_header_height">42dp</dimen>

    <!--
    The horizontal distance between the shade overlay panel (both notifications and quick settings)
    and the edge of the screen. On Compact screens in portrait orientation (< w600dp) this is
    ignored in the shade layout, which takes up the full screen width without margins.
    -->
    <dimen name="shade_panel_margin_horizontal">24dp</dimen>

    <!-- start padding is smaller to account for status icon margins coming from drawable itself -->
    <dimen name="hover_system_icons_container_padding_start">3dp</dimen>
    <dimen name="hover_system_icons_container_padding_end">4dp</dimen>
+6 −0
Original line number Diff line number Diff line
@@ -584,6 +584,12 @@
    -->
    <dimen name="shade_panel_width">412dp</dimen>

    <!--
    The horizontal distance between the shade overlay panel (both notifications and quick settings)
    and the edge of the screen. This is zero only on Compact screens (< sw600dp).
    -->
    <dimen name="shade_panel_margin_horizontal">0dp</dimen>

    <dimen name="brightness_mirror_height">48dp</dimen>

    <dimen name="volume_dialog_panel_transparent_padding_right">8dp</dimen>
+8 −6
Original line number Diff line number Diff line
@@ -228,9 +228,14 @@ constructor(
                    configurationInteractor.onAnyConfigurationChange,
                ) { isShadeLayoutWide, shadeMode, _ ->
                    with(context.resources) {
                        // TODO(b/338033836): Define separate horizontal margins for dual shade.
                        val marginHorizontal =
                            getDimensionPixelSize(R.dimen.notification_panel_margin_horizontal)
                            getDimensionPixelSize(
                                if (shadeMode is Dual) {
                                    R.dimen.shade_panel_margin_horizontal
                                } else {
                                    R.dimen.notification_panel_margin_horizontal
                                }
                            )

                        val horizontalPosition =
                            when (shadeMode) {
@@ -248,10 +253,7 @@ constructor(

                        ConfigurationBasedDimensions(
                            horizontalPosition = horizontalPosition,
                            marginStart =
                                if (horizontalPosition is HorizontalPosition.EdgeToEdge)
                                    marginHorizontal
                                else 0,
                            marginStart = if (shadeMode is Split) 0 else marginHorizontal,
                            marginEnd = marginHorizontal,
                            marginBottom =
                                getDimensionPixelSize(R.dimen.notification_panel_margin_bottom),