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

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

[Dual Shade] Don't fade out notifications as QS expands on large screen.

The quick settings shade no longer overlaps with lock screen
notifications, so there's no need to fade them out.

Fix: 395083906
Test: Tested manually by expanding the QS shade on lockscreen of an
 unfolded device and verifying that notifications remain fully visible;
 and that they still fade out when doing the same on a folded device.
Flag: com.android.systemui.scene_container
Change-Id: I31b44677854073ee97ecd344821bfb9be080732f
parent feb4d890
Loading
Loading
Loading
Loading
+14 −4
Original line number Diff line number Diff line
@@ -478,7 +478,7 @@ constructor(

    /**
     * Ensure view is visible when the shade/qs are expanded. Also, as QS is expanding, fade out
     * notifications unless in splitshade.
     * notifications unless it's a large screen.
     */
    private val alphaForShadeAndQsExpansion: Flow<Float> =
        if (SceneContainerFlag.isEnabled) {
@@ -501,16 +501,26 @@ constructor(
                        Split -> isAnyExpanded.filter { it }.map { 1f }
                        Dual ->
                            combineTransform(
                                shadeModeInteractor.isShadeLayoutWide,
                                headsUpNotificationInteractor.get().isHeadsUpOrAnimatingAway,
                                shadeInteractor.shadeExpansion,
                                shadeInteractor.qsExpansion,
                            ) { isHeadsUpOrAnimatingAway, shadeExpansion, qsExpansion ->
                                if (isHeadsUpOrAnimatingAway) {
                            ) {
                                isShadeLayoutWide,
                                isHeadsUpOrAnimatingAway,
                                shadeExpansion,
                                qsExpansion ->
                                if (isShadeLayoutWide) {
                                    if (shadeExpansion > 0f) {
                                        emit(1f)
                                    }
                                } else if (isHeadsUpOrAnimatingAway) {
                                    // Ensure HUNs will be visible in QS shade (at least while
                                    // unlocked)
                                    emit(1f)
                                } else if (shadeExpansion > 0f || qsExpansion > 0f) {
                                    // Fade out as QS shade expands
                                    // On a narrow screen, the QS shade overlaps with lockscreen
                                    // notifications. Fade them out as the QS shade expands.
                                    emit(1f - qsExpansion)
                                }
                            }