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

Commit ef70fac4 authored by Jordan Demeulenaere's avatar Jordan Demeulenaere Committed by Android (Google) Code Review
Browse files

Merge "Partial revert of ag/25744360" into main

parents 06acede0 0e18781a
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -133,18 +133,14 @@ private class MovableElementScopeImpl(
        if (shouldComposeMovableElement) {
            val movableContent: MovableElementContent =
                layoutImpl.movableContents[element]
                    ?: movableContentOf {
                            contentScope: MovableElementContentScope,
                            content: @Composable MovableElementContentScope.() -> Unit ->
                            contentScope.content()
                        }
                    ?: movableContentOf { content: @Composable () -> Unit -> content() }
                        .also { layoutImpl.movableContents[element] = it }

            // Important: Don't introduce any parent Box or other layout here, because contentScope
            // delegates its BoxScope implementation to the Box where this content() function is
            // called, so it's important that this movableContent is composed directly under that
            // Box.
            movableContent(contentScope, content)
            movableContent { contentScope.content() }
        } else {
            // If we are not composed, we still need to lay out an empty space with the same *target
            // size* as its movable content, i.e. the same *size when idle*. During transitions,
+2 −9
Original line number Diff line number Diff line
@@ -38,15 +38,8 @@ import androidx.compose.ui.util.fastForEach
import com.android.compose.ui.util.lerp
import kotlinx.coroutines.CoroutineScope

/**
 * The type for the content of movable elements.
 *
 * TODO(b/317972419): Revert back to make this movable content have a single @Composable lambda
 *   parameter.
 */
internal typealias MovableElementContent =
    @Composable
    (MovableElementContentScope, @Composable MovableElementContentScope.() -> Unit) -> Unit
/** The type for the content of movable elements. */
internal typealias MovableElementContent = @Composable (@Composable () -> Unit) -> Unit

@Stable
internal class SceneTransitionLayoutImpl(