Loading packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -528,7 +528,7 @@ private fun FoldAware( // Update state whenever currentSceneKey has changed. // Update state whenever currentSceneKey has changed. LaunchedEffect(state, currentSceneKey) { LaunchedEffect(state, currentSceneKey) { if (currentSceneKey != state.transitionState.currentScene) { if (currentSceneKey != state.transitionState.currentScene) { state.setTargetScene(currentSceneKey, coroutineScope = this) state.setTargetScene(currentSceneKey, animationScope = this) } } } } Loading packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/TopAreaSection.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -93,7 +93,7 @@ constructor( // Update state whenever currentSceneKey has changed. // Update state whenever currentSceneKey has changed. LaunchedEffect(state, currentScene) { LaunchedEffect(state, currentScene) { if (currentScene != state.transitionState.currentScene) { if (currentScene != state.transitionState.currentScene) { state.setTargetScene(currentScene, coroutineScope = this) state.setTargetScene(currentScene, animationScope = this) } } } } Loading packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneTransitionLayoutDataSource.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,7 @@ class SceneTransitionLayoutDataSource( state.setTargetScene( state.setTargetScene( targetScene = toScene, targetScene = toScene, transitionKey = transitionKey, transitionKey = transitionKey, coroutineScope = coroutineScope, animationScope = coroutineScope, ) ) } } Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -597,7 +597,7 @@ internal fun SceneTransitionLayoutForTesting( ) { ) { val density = LocalDensity.current val density = LocalDensity.current val layoutDirection = LocalLayoutDirection.current val layoutDirection = LocalLayoutDirection.current val coroutineScope = rememberCoroutineScope() val animationScope = rememberCoroutineScope() val layoutImpl = remember { val layoutImpl = remember { SceneTransitionLayoutImpl( SceneTransitionLayoutImpl( state = state as MutableSceneTransitionLayoutStateImpl, state = state as MutableSceneTransitionLayoutStateImpl, Loading @@ -606,7 +606,7 @@ internal fun SceneTransitionLayoutForTesting( swipeSourceDetector = swipeSourceDetector, swipeSourceDetector = swipeSourceDetector, transitionInterceptionThreshold = transitionInterceptionThreshold, transitionInterceptionThreshold = transitionInterceptionThreshold, builder = builder, builder = builder, animationScope = coroutineScope, animationScope = animationScope, ) ) .also { onLayoutImpl?.invoke(it) } .also { onLayoutImpl?.invoke(it) } } } Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +4 −5 Original line number Original line Diff line number Diff line Loading @@ -121,14 +121,13 @@ sealed interface MutableSceneTransitionLayoutState : SceneTransitionLayoutState * might still be interrupted, for instance by another call to [setTargetScene] or by a user * might still be interrupted, for instance by another call to [setTargetScene] or by a user * gesture. * gesture. * * * If [coroutineScope] is cancelled during the transition and that the transition was still * If [animationScope] is cancelled during the transition and that the transition was still * active, then the [transitionState] of this [MutableSceneTransitionLayoutState] will be set to * active, then the [transitionState] of this [MutableSceneTransitionLayoutState] will be set to * `TransitionState.Idle(targetScene)`. * `TransitionState.Idle(targetScene)`. */ */ fun setTargetScene( fun setTargetScene( targetScene: SceneKey, targetScene: SceneKey, // TODO(b/362727477): Rename to animationScope. animationScope: CoroutineScope, coroutineScope: CoroutineScope, transitionKey: TransitionKey? = null, transitionKey: TransitionKey? = null, ): Pair<TransitionState.Transition, Job>? ): Pair<TransitionState.Transition, Job>? Loading Loading @@ -302,12 +301,12 @@ internal class MutableSceneTransitionLayoutStateImpl( override fun setTargetScene( override fun setTargetScene( targetScene: SceneKey, targetScene: SceneKey, coroutineScope: CoroutineScope, animationScope: CoroutineScope, transitionKey: TransitionKey?, transitionKey: TransitionKey?, ): Pair<TransitionState.Transition.ChangeScene, Job>? { ): Pair<TransitionState.Transition.ChangeScene, Job>? { checkThread() checkThread() return coroutineScope.animateToScene( return animationScope.animateToScene( layoutState = this@MutableSceneTransitionLayoutStateImpl, layoutState = this@MutableSceneTransitionLayoutStateImpl, target = targetScene, target = targetScene, transitionKey = transitionKey, transitionKey = transitionKey, Loading Loading
packages/SystemUI/compose/features/src/com/android/systemui/bouncer/ui/composable/BouncerContent.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -528,7 +528,7 @@ private fun FoldAware( // Update state whenever currentSceneKey has changed. // Update state whenever currentSceneKey has changed. LaunchedEffect(state, currentSceneKey) { LaunchedEffect(state, currentSceneKey) { if (currentSceneKey != state.transitionState.currentScene) { if (currentSceneKey != state.transitionState.currentScene) { state.setTargetScene(currentSceneKey, coroutineScope = this) state.setTargetScene(currentSceneKey, animationScope = this) } } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/keyguard/ui/composable/section/TopAreaSection.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -93,7 +93,7 @@ constructor( // Update state whenever currentSceneKey has changed. // Update state whenever currentSceneKey has changed. LaunchedEffect(state, currentScene) { LaunchedEffect(state, currentScene) { if (currentScene != state.transitionState.currentScene) { if (currentScene != state.transitionState.currentScene) { state.setTargetScene(currentScene, coroutineScope = this) state.setTargetScene(currentScene, animationScope = this) } } } } Loading
packages/SystemUI/compose/features/src/com/android/systemui/scene/ui/composable/SceneTransitionLayoutDataSource.kt +1 −1 Original line number Original line Diff line number Diff line Loading @@ -69,7 +69,7 @@ class SceneTransitionLayoutDataSource( state.setTargetScene( state.setTargetScene( targetScene = toScene, targetScene = toScene, transitionKey = transitionKey, transitionKey = transitionKey, coroutineScope = coroutineScope, animationScope = coroutineScope, ) ) } } Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayout.kt +2 −2 Original line number Original line Diff line number Diff line Loading @@ -597,7 +597,7 @@ internal fun SceneTransitionLayoutForTesting( ) { ) { val density = LocalDensity.current val density = LocalDensity.current val layoutDirection = LocalLayoutDirection.current val layoutDirection = LocalLayoutDirection.current val coroutineScope = rememberCoroutineScope() val animationScope = rememberCoroutineScope() val layoutImpl = remember { val layoutImpl = remember { SceneTransitionLayoutImpl( SceneTransitionLayoutImpl( state = state as MutableSceneTransitionLayoutStateImpl, state = state as MutableSceneTransitionLayoutStateImpl, Loading @@ -606,7 +606,7 @@ internal fun SceneTransitionLayoutForTesting( swipeSourceDetector = swipeSourceDetector, swipeSourceDetector = swipeSourceDetector, transitionInterceptionThreshold = transitionInterceptionThreshold, transitionInterceptionThreshold = transitionInterceptionThreshold, builder = builder, builder = builder, animationScope = coroutineScope, animationScope = animationScope, ) ) .also { onLayoutImpl?.invoke(it) } .also { onLayoutImpl?.invoke(it) } } } Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SceneTransitionLayoutState.kt +4 −5 Original line number Original line Diff line number Diff line Loading @@ -121,14 +121,13 @@ sealed interface MutableSceneTransitionLayoutState : SceneTransitionLayoutState * might still be interrupted, for instance by another call to [setTargetScene] or by a user * might still be interrupted, for instance by another call to [setTargetScene] or by a user * gesture. * gesture. * * * If [coroutineScope] is cancelled during the transition and that the transition was still * If [animationScope] is cancelled during the transition and that the transition was still * active, then the [transitionState] of this [MutableSceneTransitionLayoutState] will be set to * active, then the [transitionState] of this [MutableSceneTransitionLayoutState] will be set to * `TransitionState.Idle(targetScene)`. * `TransitionState.Idle(targetScene)`. */ */ fun setTargetScene( fun setTargetScene( targetScene: SceneKey, targetScene: SceneKey, // TODO(b/362727477): Rename to animationScope. animationScope: CoroutineScope, coroutineScope: CoroutineScope, transitionKey: TransitionKey? = null, transitionKey: TransitionKey? = null, ): Pair<TransitionState.Transition, Job>? ): Pair<TransitionState.Transition, Job>? Loading Loading @@ -302,12 +301,12 @@ internal class MutableSceneTransitionLayoutStateImpl( override fun setTargetScene( override fun setTargetScene( targetScene: SceneKey, targetScene: SceneKey, coroutineScope: CoroutineScope, animationScope: CoroutineScope, transitionKey: TransitionKey?, transitionKey: TransitionKey?, ): Pair<TransitionState.Transition.ChangeScene, Job>? { ): Pair<TransitionState.Transition.ChangeScene, Job>? { checkThread() checkThread() return coroutineScope.animateToScene( return animationScope.animateToScene( layoutState = this@MutableSceneTransitionLayoutStateImpl, layoutState = this@MutableSceneTransitionLayoutStateImpl, target = targetScene, target = targetScene, transitionKey = transitionKey, transitionKey = transitionKey, Loading