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

Commit c9db0f87 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Set NSSL drawbounds from the GONE Scene" into main

parents 08273042 30289c58
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() },