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

Commit 30289c58 authored by András Kurucz's avatar András Kurucz
Browse files

[Flexiglass] Set NSSL drawbounds from the GONE Scene

NSSL received incorrect draw bounds while there was a HUN over
Scenes.GONE. This was a temporarily measure here, and didn't cause any
issues in the current code, but these 0 values were technically
incorrect and misleading in the current NSSL code.

Bug: 417965077
Test: check HUN transitions over GONE
Test: check GONE -> Shade transition by dragging on a HUN
Flag: com.android.systemui.scene_container
Change-Id: I92a7798f8b52c52014e7cecc953dba26b82d5af7
parent baf43d63
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -181,6 +181,7 @@ fun ContentScope.HeadsUpNotificationSpace(
fun ContentScope.SnoozeableHeadsUpNotificationSpace(
    stackScrollView: NotificationScrollView,
    viewModel: NotificationsPlaceholderViewModel,
    modifier: Modifier = Modifier,
) {

    val isSnoozable by viewModel.isHeadsUpOrAnimatingAway.collectAsStateWithLifecycle(false)
@@ -227,7 +228,8 @@ fun ContentScope.SnoozeableHeadsUpNotificationSpace(
        stackScrollView = stackScrollView,
        viewModel = viewModel,
        modifier =
            Modifier.absoluteOffset {
            modifier
                .absoluteOffset {
                    IntOffset(
                        x = 0,
                        y =
+19 −2
Original line number Diff line number Diff line
@@ -16,7 +16,6 @@

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

import android.graphics.RectF
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.runtime.Composable
@@ -25,6 +24,9 @@ import androidx.compose.runtime.derivedStateOf
import androidx.compose.runtime.getValue
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.toAndroidRectF
import androidx.compose.ui.layout.boundsInWindow
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalDensity
import com.android.compose.animation.scene.ContentScope
import com.android.compose.animation.scene.UserAction
@@ -94,7 +96,6 @@ constructor(
                notificationStackScrolLView.get().apply {
                    // use -headsUpInset to allow HUN translation outside bounds for snoozing
                    setStackTop(-headsUpInset)
                    updateDrawBounds(RectF())
                }
            }
        }
@@ -106,6 +107,22 @@ constructor(
        animateContentDpAsState(value = Default, key = MediaLandscapeTopOffset, canOverflow = false)
        Spacer(modifier.fillMaxSize())
        SnoozeableHeadsUpNotificationSpace(
            modifier =
                Modifier.onGloballyPositioned {
                    // Once we are on the non-occluded Lockscreen, the regular stack is not setting
                    // draw bounds anymore, but HUNs can still appear.
                    if (isIdleAndNotOccluded) {
                        notificationStackScrolLView
                            .get()
                            .updateDrawBounds(
                                it.boundsInWindow().toAndroidRectF().apply {
                                    // extend bounds to the screen top to avoid cutting off HUN
                                    // transitions
                                    top = 0f
                                }
                            )
                    }
                },
            stackScrollView = notificationStackScrolLView.get(),
            viewModel =
                rememberViewModel("GoneScene") { notificationsPlaceholderViewModelFactory.create() },