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

Commit 62bdb554 authored by 0's avatar 0
Browse files

[flexiglass] Fix remote input case when notifs aren't overflowing

The LaunchedEffect to return the scrim to 0 offset when stack height isn't overflowing was fighting the LaunchedEffect that changes scrim offset to make room for the IME.

Bug: 375632579
Test: manually verified scrim offset correctly changes for inline reply in this scenario
Flag: com.android.systemui.scene_container
Change-Id: Id494c49f91408c3e68c9b967072e6eb7fea025a4
parent 5bc4afb9
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -355,9 +355,13 @@ fun SceneScope.NotificationScrollingStack(
    }

    // if contentHeight drops below minimum visible scrim height while scrim is
    // expanded, reset scrim offset.
    LaunchedEffect(stackHeight, scrimOffset) {
        snapshotFlow { stackHeight.intValue < minVisibleScrimHeight() && scrimOffset.value < 0f }
    // expanded and IME is not showing, reset scrim offset.
    LaunchedEffect(stackHeight, scrimOffset, imeTop) {
        snapshotFlow {
                stackHeight.intValue < minVisibleScrimHeight() &&
                    scrimOffset.value < 0f &&
                    imeTop.floatValue <= 0f
            }
            .collect { shouldCollapse -> if (shouldCollapse) scrimOffset.animateTo(0f, tween()) }
    }