Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +32 −27 Original line number Diff line number Diff line Loading @@ -176,6 +176,35 @@ sealed interface MutableSceneTransitionLayoutState : SceneTransitionLayoutState animationScope: CoroutineScope, transitionKey: TransitionKey? = null, ) /** * Instantly start a [transition], running it in [animationScope]. * * This call returns immediately and [transition] will be the [currentTransition] of this * [MutableSceneTransitionLayoutState]. * * @see startTransition */ fun startTransitionImmediately( animationScope: CoroutineScope, transition: TransitionState.Transition, chain: Boolean = true, ): Job /** * Start a new [transition]. * * If [chain] is `true`, then the transitions will simply be added to [currentTransitions] and * will run in parallel to the current transitions. If [chain] is `false`, then the list of * [currentTransitions] will be cleared and [transition] will be the only running transition. * * If any transition is currently ongoing, it will be interrupted and forced to animate to its * current state by calling [TransitionState.Transition.freezeAndAnimateToCurrentState]. * * This method returns when [transition] is done running, i.e. when the call to * [run][TransitionState.Transition.run] returns. */ suspend fun startTransition(transition: TransitionState.Transition, chain: Boolean = true) } /** Loading Loading @@ -313,18 +342,10 @@ internal class MutableSceneTransitionLayoutStateImpl( ) } /** * Instantly start a [transition], running it in [animationScope]. * * This call returns immediately and [transition] will be the [currentTransition] of this * [MutableSceneTransitionLayoutState]. * * @see startTransition */ internal fun startTransitionImmediately( override fun startTransitionImmediately( animationScope: CoroutineScope, transition: TransitionState.Transition, chain: Boolean = true, chain: Boolean, ): Job { // Note that we start with UNDISPATCHED so that startTransition() is called directly and // transition becomes the current [transitionState] right after this call. Loading @@ -333,23 +354,7 @@ internal class MutableSceneTransitionLayoutStateImpl( } } /** * Start a new [transition]. * * If [chain] is `true`, then the transitions will simply be added to [currentTransitions] and * will run in parallel to the current transitions. If [chain] is `false`, then the list of * [currentTransitions] will be cleared and [transition] will be the only running transition. * * If any transition is currently ongoing, it will be interrupted and forced to animate to its * current state. * * This method returns when [transition] is done running, i.e. when the call to * [run][TransitionState.Transition.run] returns. */ internal suspend fun startTransition( transition: TransitionState.Transition, chain: Boolean = true, ) { override suspend fun startTransition(transition: TransitionState.Transition, chain: Boolean) { checkThread() try { Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt +2 −2 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ sealed interface TransitionState { } /** Run this transition and return once it is finished. */ internal abstract suspend fun run() abstract suspend fun run() /** * Freeze this transition state so that neither [currentScene] nor [currentOverlays] will Loading @@ -311,7 +311,7 @@ sealed interface TransitionState { * * This is called when this transition is interrupted (replaced) by another transition. */ internal abstract fun freezeAndAnimateToCurrentState() abstract fun freezeAndAnimateToCurrentState() internal fun updateOverscrollSpecs( fromSpec: OverscrollSpecImpl?, Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +32 −27 Original line number Diff line number Diff line Loading @@ -176,6 +176,35 @@ sealed interface MutableSceneTransitionLayoutState : SceneTransitionLayoutState animationScope: CoroutineScope, transitionKey: TransitionKey? = null, ) /** * Instantly start a [transition], running it in [animationScope]. * * This call returns immediately and [transition] will be the [currentTransition] of this * [MutableSceneTransitionLayoutState]. * * @see startTransition */ fun startTransitionImmediately( animationScope: CoroutineScope, transition: TransitionState.Transition, chain: Boolean = true, ): Job /** * Start a new [transition]. * * If [chain] is `true`, then the transitions will simply be added to [currentTransitions] and * will run in parallel to the current transitions. If [chain] is `false`, then the list of * [currentTransitions] will be cleared and [transition] will be the only running transition. * * If any transition is currently ongoing, it will be interrupted and forced to animate to its * current state by calling [TransitionState.Transition.freezeAndAnimateToCurrentState]. * * This method returns when [transition] is done running, i.e. when the call to * [run][TransitionState.Transition.run] returns. */ suspend fun startTransition(transition: TransitionState.Transition, chain: Boolean = true) } /** Loading Loading @@ -313,18 +342,10 @@ internal class MutableSceneTransitionLayoutStateImpl( ) } /** * Instantly start a [transition], running it in [animationScope]. * * This call returns immediately and [transition] will be the [currentTransition] of this * [MutableSceneTransitionLayoutState]. * * @see startTransition */ internal fun startTransitionImmediately( override fun startTransitionImmediately( animationScope: CoroutineScope, transition: TransitionState.Transition, chain: Boolean = true, chain: Boolean, ): Job { // Note that we start with UNDISPATCHED so that startTransition() is called directly and // transition becomes the current [transitionState] right after this call. Loading @@ -333,23 +354,7 @@ internal class MutableSceneTransitionLayoutStateImpl( } } /** * Start a new [transition]. * * If [chain] is `true`, then the transitions will simply be added to [currentTransitions] and * will run in parallel to the current transitions. If [chain] is `false`, then the list of * [currentTransitions] will be cleared and [transition] will be the only running transition. * * If any transition is currently ongoing, it will be interrupted and forced to animate to its * current state. * * This method returns when [transition] is done running, i.e. when the call to * [run][TransitionState.Transition.run] returns. */ internal suspend fun startTransition( transition: TransitionState.Transition, chain: Boolean = true, ) { override suspend fun startTransition(transition: TransitionState.Transition, chain: Boolean) { checkThread() try { Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/content/state/TransitionState.kt +2 −2 Original line number Diff line number Diff line Loading @@ -300,7 +300,7 @@ sealed interface TransitionState { } /** Run this transition and return once it is finished. */ internal abstract suspend fun run() abstract suspend fun run() /** * Freeze this transition state so that neither [currentScene] nor [currentOverlays] will Loading @@ -311,7 +311,7 @@ sealed interface TransitionState { * * This is called when this transition is interrupted (replaced) by another transition. */ internal abstract fun freezeAndAnimateToCurrentState() abstract fun freezeAndAnimateToCurrentState() internal fun updateOverscrollSpecs( fromSpec: OverscrollSpecImpl?, Loading