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

Commit 56cc8bef authored by András Kurucz's avatar András Kurucz Committed by Android (Google) Code Review
Browse files

Merge "[Flexiglass] Make NotificationStackCutoffGuideline a shared element" into main

parents 3c8b83a3 4791b8f7
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ object Notifications {
        val HeadsUpNotificationPlaceholder =
            ElementKey("HeadsUpNotificationPlaceholder", scenePicker = LowestZIndexScenePicker)
        val ShelfSpace = ElementKey("ShelfSpace")
        val NotificationStackCutoffGuideline = ElementKey("NotificationStackCutoffGuideline")
    }

    // Expansion fraction thresholds (between 0-1f) at which the corresponding value should be
@@ -410,14 +411,18 @@ fun SceneScope.NotificationShelfSpace(
 * the notification contents (stack, footer, shelf) should be drawn.
 */
@Composable
fun NotificationStackCutoffGuideline(
fun SceneScope.NotificationStackCutoffGuideline(
    stackScrollView: NotificationScrollView,
    viewModel: NotificationsPlaceholderViewModel,
    modifier: Modifier = Modifier,
) {
    Spacer(
        modifier =
            modifier.fillMaxWidth().height(0.dp).onGloballyPositioned { coordinates ->
            modifier
                .element(key = Notifications.Elements.NotificationStackCutoffGuideline)
                .fillMaxWidth()
                .height(0.dp)
                .onGloballyPositioned { coordinates ->
                    val positionY = coordinates.positionInWindow().y
                    debugLog(viewModel) { "STACK cutoff onGloballyPositioned: y=$positionY" }
                    stackScrollView.setStackCutoff(positionY)