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

Commit 02ad3b38 authored by Ben Lin's avatar Ben Lin
Browse files

[flexiglass] Allow dual notification shade to align to the bottom.

This allows NotificationsShadeScene to be customized such that instead
of align to the top, it is now align to the bottom (positioning to the
right side remains unchanged).

This also adds a new transition to the framework so that when it is on
the bottom, the scene appears from the bottom edge rather than the top.

Flag: com.android.systemui.scene_container
Bug: 343744476
Test: Manual; Change config.xml content to be true instead, and then
call on adb shell service call statusbar 1 to see animation
Test: Manual; verify on Goldfish phone emulator with flexiglass on flag
off still works

Change-Id: Id44ad8ca9be2a9d2b35caed657589eebe164160c
parent a956e72a
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -20,7 +20,6 @@ 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
@@ -75,7 +74,6 @@ constructor(
        OverlayShade(
            modifier = modifier,
            viewModel = overlayShadeViewModel,
            panelAlignment = Alignment.TopEnd,
            lockscreenContent = lockscreenContent,
        ) {
            Column {
+0 −1
Original line number Diff line number Diff line
@@ -82,7 +82,6 @@ constructor(
    ) {
        OverlayShade(
            viewModel = viewModel.overlayShadeViewModel,
            panelAlignment = Alignment.TopEnd,
            lockscreenContent = lockscreenContent,
            modifier = modifier,
        ) {
+8 −1
Original line number Diff line number Diff line
package com.android.systemui.scene.ui.composable

import androidx.compose.foundation.gestures.Orientation
import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.transitions
import com.android.systemui.bouncer.ui.composable.Bouncer
import com.android.systemui.notifications.ui.composable.Notifications
import com.android.systemui.scene.shared.model.Scenes
import com.android.systemui.scene.shared.model.TransitionKeys.OpenBottomShade
import com.android.systemui.scene.shared.model.TransitionKeys.SlightlyFasterShadeCollapse
import com.android.systemui.scene.shared.model.TransitionKeys.ToSplitShade
import com.android.systemui.scene.ui.composable.transitions.bouncerToGoneTransition
@@ -42,7 +44,12 @@ val SceneContainerTransitions = transitions {
    // Scene transitions

    from(Scenes.Bouncer, to = Scenes.Gone) { bouncerToGoneTransition() }
    from(Scenes.Gone, to = Scenes.NotificationsShade) { goneToNotificationsShadeTransition() }
    from(Scenes.Gone, to = Scenes.NotificationsShade) {
        goneToNotificationsShadeTransition(Edge.Top)
    }
    from(Scenes.Gone, to = Scenes.NotificationsShade, key = OpenBottomShade) {
        goneToNotificationsShadeTransition(Edge.Bottom)
    }
    from(Scenes.Gone, to = Scenes.Shade) { goneToShadeTransition() }
    from(
        Scenes.Gone,
+3 −1
Original line number Diff line number Diff line
@@ -16,10 +16,12 @@

package com.android.systemui.scene.ui.composable.transitions

import com.android.compose.animation.scene.Edge
import com.android.compose.animation.scene.TransitionBuilder

fun TransitionBuilder.goneToNotificationsShadeTransition(
    edge: Edge = Edge.Top,
    durationScale: Double = 1.0,
) {
    toNotificationsShadeTransition(durationScale)
    toNotificationsShadeTransition(edge, durationScale)
}
+1 −1
Original line number Diff line number Diff line
@@ -21,5 +21,5 @@ import com.android.compose.animation.scene.TransitionBuilder
fun TransitionBuilder.lockscreenToNotificationsShadeTransition(
    durationScale: Double = 1.0,
) {
    toNotificationsShadeTransition(durationScale)
    toNotificationsShadeTransition(durationScale = durationScale)
}
Loading