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

Commit 0864bd93 authored by Lucas Silva's avatar Lucas Silva Committed by Android (Google) Code Review
Browse files

Merge "Fix dreaming to GH transition in v2" into main

parents 51308094 1608b3ab
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -93,6 +93,10 @@ val sceneTransitionsV2 = transitions {
        spec = tween(durationMillis = TransitionDuration.TO_GLANCEABLE_HUB_DURATION_MS)
        fade(AllElements)
    }
    to(CommunalScenes.Communal, key = CommunalTransitionKeys.FromOccluded) {
        spec = tween(durationMillis = TransitionDuration.TO_GLANCEABLE_HUB_DURATION_MS)
        timestampRange(startMillis = 250) { fade(AllElements) }
    }
    to(CommunalScenes.Communal, key = CommunalTransitionKeys.Swipe) {
        spec = tween(durationMillis = TransitionDuration.TO_GLANCEABLE_HUB_DURATION_MS)
        translate(Communal.Elements.Grid, Edge.End)
+2 −0
Original line number Diff line number Diff line
@@ -33,6 +33,8 @@ object CommunalTransitionKeys {
    val FromEditMode = TransitionKey("FromEditMode")
    /** Swipes the glanceable hub in/out of view */
    val Swipe = TransitionKey("Swipe")
    /** Transition from occluded state to the glanceable hub */
    val FromOccluded = TransitionKey("FromOccluded")
    /** Swipes out of glanceable hub in landscape orientation */
    val SwipeInLandscape = TransitionKey("SwipeInLandscape")
}
+1 −1
Original line number Diff line number Diff line
@@ -175,7 +175,7 @@ constructor(
                            loggingReason = "FromDreamingTransitionInteractor",
                            transitionKey =
                                if (communalSettingsInteractor.isV2FlagEnabled())
                                    CommunalTransitionKeys.SimpleFade
                                    CommunalTransitionKeys.FromOccluded
                                else null,
                        )
                    } else {
+13 −1
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ package com.android.systemui.keyguard.ui.viewmodel
import android.util.LayoutDirection
import com.android.app.animation.Interpolators.EMPHASIZED
import com.android.systemui.common.ui.domain.interactor.ConfigurationInteractor
import com.android.systemui.communal.domain.interactor.CommunalSettingsInteractor
import com.android.systemui.dagger.SysUISingleton
import com.android.systemui.keyguard.dagger.GlanceableHubBlurComponent
import com.android.systemui.keyguard.shared.model.Edge
@@ -44,6 +45,7 @@ constructor(
    animationFlow: KeyguardTransitionAnimationFlow,
    @ShadeDisplayAware configurationInteractor: ConfigurationInteractor,
    private val blurFactory: GlanceableHubBlurComponent.Factory,
    private val communalSettingsInteractor: CommunalSettingsInteractor,
) : DeviceEntryIconTransition, GlanceableHubTransition {
    private val transitionAnimation =
        animationFlow
@@ -70,7 +72,17 @@ constructor(
            }

    // Keep the dream visible while the hub swipes in over the dream.
    val dreamAlpha: Flow<Float> = transitionAnimation.immediatelyTransitionTo(1f)
    val dreamAlpha: Flow<Float> by lazy {
        if (communalSettingsInteractor.isV2FlagEnabled()) {
            transitionAnimation.sharedFlow(
                duration = 250.milliseconds,
                onStep = { 1f - it },
                name = "DREAMING->GLANCEABLE_HUB: dreamAlpha",
            )
        } else {
            transitionAnimation.immediatelyTransitionTo(1f)
        }
    }

    val dreamOverlayAlpha: Flow<Float> =
        transitionAnimation.sharedFlow(
+2 −0
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package com.android.systemui.keyguard.ui.viewmodel

import com.android.systemui.common.ui.domain.interactor.configurationInteractor
import com.android.systemui.communal.domain.interactor.communalSettingsInteractor
import com.android.systemui.keyguard.ui.glanceableHubBlurComponentFactory
import com.android.systemui.keyguard.ui.keyguardTransitionAnimationFlow
import com.android.systemui.kosmos.Kosmos
@@ -27,5 +28,6 @@ val Kosmos.dreamingToGlanceableHubTransitionViewModel by
            configurationInteractor = configurationInteractor,
            animationFlow = keyguardTransitionAnimationFlow,
            blurFactory = glanceableHubBlurComponentFactory,
            communalSettingsInteractor = communalSettingsInteractor,
        )
    }