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

Commit c3541cbc authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge changes I469d64e6,I562ce1e0 into main

* changes:
  Allow to define overscroll specs for overlays
  Rename coroutineScope to animationScope
parents a776451e 53f7942d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -528,7 +528,7 @@ private fun FoldAware(
    // Update state whenever currentSceneKey has changed.
    LaunchedEffect(state, currentSceneKey) {
        if (currentSceneKey != state.transitionState.currentScene) {
            state.setTargetScene(currentSceneKey, coroutineScope = this)
            state.setTargetScene(currentSceneKey, animationScope = this)
        }
    }

+1 −1
Original line number Diff line number Diff line
@@ -93,7 +93,7 @@ constructor(
        // Update state whenever currentSceneKey has changed.
        LaunchedEffect(state, currentScene) {
            if (currentScene != state.transitionState.currentScene) {
                state.setTargetScene(currentScene, coroutineScope = this)
                state.setTargetScene(currentScene, animationScope = this)
            }
        }

+1 −1
Original line number Diff line number Diff line
@@ -69,7 +69,7 @@ class SceneTransitionLayoutDataSource(
        state.setTargetScene(
            targetScene = toScene,
            transitionKey = transitionKey,
            coroutineScope = coroutineScope,
            animationScope = coroutineScope,
        )
    }

+2 −2
Original line number Diff line number Diff line
@@ -597,7 +597,7 @@ internal fun SceneTransitionLayoutForTesting(
) {
    val density = LocalDensity.current
    val layoutDirection = LocalLayoutDirection.current
    val coroutineScope = rememberCoroutineScope()
    val animationScope = rememberCoroutineScope()
    val layoutImpl = remember {
        SceneTransitionLayoutImpl(
                state = state as MutableSceneTransitionLayoutStateImpl,
@@ -606,7 +606,7 @@ internal fun SceneTransitionLayoutForTesting(
                swipeSourceDetector = swipeSourceDetector,
                transitionInterceptionThreshold = transitionInterceptionThreshold,
                builder = builder,
                animationScope = coroutineScope,
                animationScope = animationScope,
            )
            .also { onLayoutImpl?.invoke(it) }
    }
+4 −5
Original line number Diff line number Diff line
@@ -121,14 +121,13 @@ sealed interface MutableSceneTransitionLayoutState : SceneTransitionLayoutState
     * might still be interrupted, for instance by another call to [setTargetScene] or by a user
     * 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
     * `TransitionState.Idle(targetScene)`.
     */
    fun setTargetScene(
        targetScene: SceneKey,
        // TODO(b/362727477): Rename to animationScope.
        coroutineScope: CoroutineScope,
        animationScope: CoroutineScope,
        transitionKey: TransitionKey? = null,
    ): Pair<TransitionState.Transition, Job>?

@@ -302,12 +301,12 @@ internal class MutableSceneTransitionLayoutStateImpl(

    override fun setTargetScene(
        targetScene: SceneKey,
        coroutineScope: CoroutineScope,
        animationScope: CoroutineScope,
        transitionKey: TransitionKey?,
    ): Pair<TransitionState.Transition.ChangeScene, Job>? {
        checkThread()

        return coroutineScope.animateToScene(
        return animationScope.animateToScene(
            layoutState = this@MutableSceneTransitionLayoutStateImpl,
            target = targetScene,
            transitionKey = transitionKey,
Loading