Skip to content

Commit

Permalink
[bc25] Support both horizontal and vertical alignment in dual shade.
Browse files Browse the repository at this point in the history
This is necessary to allow dual shade to be invoked from the bottom on
other system UI variants, such as ARC.

Test: Manually tested by opening and closing the quick settings shade on
a foldable device both in a folded and unfolded configuration.
Test: Unit tests build and pass.
Bug: 343744476
Flag: com.android.systemui.dual_shade

Change-Id: Idf48a30f317c2d318d3ba80d447abbb4f6377f99
  • Loading branch information
burakov committed Jun 4, 2024
1 parent 57f25a8 commit 51ea31d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@

package com.android.systemui.notifications.ui.composable

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.android.compose.animation.scene.SceneScope
Expand Down Expand Up @@ -75,7 +75,7 @@ constructor(
OverlayShade(
modifier = modifier,
viewModel = overlayShadeViewModel,
horizontalArrangement = Arrangement.End,
panelAlignment = Alignment.TopEnd,
lockscreenContent = lockscreenContent,
) {
Column {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ constructor(
) {
OverlayShade(
viewModel = viewModel.overlayShadeViewModel,
horizontalArrangement = Arrangement.End,
panelAlignment = Alignment.TopEnd,
lockscreenContent = lockscreenContent,
modifier = modifier,
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@ package com.android.systemui.shade.ui.composable

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.ExperimentalLayoutApi
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.asPaddingValues
Expand All @@ -43,6 +41,7 @@ import androidx.compose.material3.windowsizeclass.WindowWidthSizeClass
import androidx.compose.runtime.Composable
import androidx.compose.runtime.ReadOnlyComposable
import androidx.compose.runtime.getValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand All @@ -64,7 +63,7 @@ import java.util.Optional
@Composable
fun SceneScope.OverlayShade(
viewModel: OverlayShadeViewModel,
horizontalArrangement: Arrangement.Horizontal,
panelAlignment: Alignment,
lockscreenContent: Lazy<Optional<LockscreenContent>>,
modifier: Modifier = Modifier,
content: @Composable () -> Unit,
Expand All @@ -81,9 +80,9 @@ fun SceneScope.OverlayShade(

Scrim(onClicked = viewModel::onScrimClicked)

Row(
Box(
modifier = Modifier.fillMaxSize().panelPadding(),
horizontalArrangement = horizontalArrangement,
contentAlignment = panelAlignment,
) {
Panel(
modifier = Modifier.element(OverlayShade.Elements.Panel).panelSize(),
Expand Down

0 comments on commit 51ea31d

Please sign in to comment.