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

Commit 2acae06f authored by Shawn Lee's avatar Shawn Lee Committed by Android (Google) Code Review
Browse files

Merge "[flexiglass] Fix HUN shared element transitions" into main

parents 796f92be c404cd34
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -259,6 +259,7 @@ fun SceneScope.ConstrainedNotificationStack(
        HeadsUpNotificationSpace(
            stackScrollView = stackScrollView,
            viewModel = viewModel,
            useHunBounds = { shouldUseLockscreenHunBounds(layoutState.transitionState) },
            modifier = Modifier.align(Alignment.TopCenter),
        )
        NotificationStackCutoffGuideline(
@@ -541,6 +542,7 @@ fun SceneScope.NotificationScrollingStack(
            HeadsUpNotificationSpace(
                stackScrollView = stackScrollView,
                viewModel = viewModel,
                useHunBounds = { !shouldUseLockscreenHunBounds(layoutState.transitionState) },
                modifier = Modifier.padding(top = topPadding),
            )
        }
@@ -675,6 +677,14 @@ private fun shouldUseLockscreenStackBounds(state: TransitionState): Boolean {
    return state is TransitionState.Idle && state.currentScene == Scenes.Lockscreen
}

private fun shouldUseLockscreenHunBounds(state: TransitionState): Boolean {
    return when (state) {
        is TransitionState.Idle -> state.currentScene == Scenes.Lockscreen
        is TransitionState.Transition ->
            state.isTransitioning(from = Scenes.QuickSettings, to = Scenes.Lockscreen)
    }
}

private fun shouldAnimateScrimCornerRadius(
    state: SceneTransitionLayoutState,
    shouldPunchHoleBehindScrim: Boolean,
+1 −0
Original line number Diff line number Diff line
@@ -85,6 +85,7 @@ val SceneContainerTransitions = transitions {
    from(Scenes.Shade, to = Scenes.Lockscreen) {
        reversed { lockscreenToShadeTransition() }
        sharedElement(Notifications.Elements.NotificationStackPlaceholder, enabled = false)
        sharedElement(Notifications.Elements.HeadsUpNotificationPlaceholder, enabled = false)
    }

    // Overlay transitions