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

Commit caa6c158 authored by András Kurucz's avatar András Kurucz
Browse files

[flexiglass] Fix the scroll offset in Single Shade

When nested scrolling is enabled, the scrim is always offseted at least
by the collapsed header height. Add this as bottom padding to the scrim,
so it will match the visible scrim height when its fully expanded,
and we will able to scroll through the entire stack content.

Bug: 380210512
Test: check the bottom padding of the stack in single shade
	- empty shade (no notifications)
	- few notifications (not enough to have a full height shade)
	- lots of notifications (enough to scroll the shade)
Flag: com.android.systemui.scene_container
Change-Id: I125a22becd29c70f19fa8d954e8c4076fa3920b3
parent 163ee79a
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -340,11 +340,12 @@ fun ContentScope.NotificationScrollingStack(
    // set the bounds to null when the scrim disappears
    DisposableEffect(Unit) { onDispose { viewModel.onScrimBoundsChanged(null) } }

    val minScrimTop = with(density) { ShadeHeader.Dimensions.CollapsedHeight.toPx() }
    // Top position if the scrim, when it is fully expanded.
    val minScrimTop = ShadeHeader.Dimensions.CollapsedHeight

    // The minimum offset for the scrim. The scrim is considered fully expanded when it
    // is at this offset.
    val minScrimOffset: () -> Float = { minScrimTop - maxScrimTop() }
    val minScrimOffset: () -> Float = { with(density) { minScrimTop.toPx() } - maxScrimTop() }

    // The height of the scrim visible on screen when it is in its resting (collapsed) state.
    val minVisibleScrimHeight: () -> Float = {
@@ -563,6 +564,7 @@ fun ContentScope.NotificationScrollingStack(
                    }
                    .thenIf(shouldShowScrim) { Modifier.background(scrimBackgroundColor) }
                    .thenIf(shouldFillMaxSize) { Modifier.fillMaxSize() }
                    .thenIf(supportNestedScrolling) { Modifier.padding(bottom = minScrimTop) }
                    .debugBackground(viewModel, DEBUG_BOX_COLOR)
        ) {
            Column(
+1 −1
Original line number Diff line number Diff line
@@ -239,7 +239,7 @@ private fun SceneScope.ShadeScene(
                modifier = modifier,
                shadeSession = shadeSession,
            )
        is ShadeMode.Dual -> error("Dual shade is not yet implemented!")
        is ShadeMode.Dual -> error("Dual shade is implemented separately as an overlay.")
    }
}