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

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

Merge "Rename PropertyTransformation.transform.value to idleValue" into main

parents 6e776a24 0fbbba1c
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ internal class AnchoredSize(
        content: ContentKey,
        element: ElementKey,
        transition: TransitionState.Transition,
        value: IntSize,
        idleValue: IntSize,
    ): IntSize {
        fun anchorSizeIn(content: ContentKey): IntSize {
            val size =
@@ -45,8 +45,8 @@ internal class AnchoredSize(
                    )

            return IntSize(
                width = if (anchorWidth) size.width else value.width,
                height = if (anchorHeight) size.height else value.height,
                width = if (anchorWidth) size.width else idleValue.width,
                height = if (anchorHeight) size.height else idleValue.height,
            )
        }

+3 −3
Original line number Diff line number Diff line
@@ -31,7 +31,7 @@ internal class AnchoredTranslate(
        content: ContentKey,
        element: ElementKey,
        transition: TransitionState.Transition,
        value: Offset,
        idleValue: Offset,
    ): Offset {
        fun throwException(content: ContentKey?): Nothing {
            throwMissingAnchorException(
@@ -51,9 +51,9 @@ internal class AnchoredTranslate(
        val offset = anchorToOffset - anchorFromOffset

        return if (content == transition.toContent) {
            Offset(value.x - offset.x, value.y - offset.y)
            Offset(idleValue.x - offset.x, idleValue.y - offset.y)
        } else {
            Offset(value.x + offset.x, value.y + offset.y)
            Offset(idleValue.x + offset.x, idleValue.y + offset.y)
        }
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ internal class DrawScale(
        content: ContentKey,
        element: ElementKey,
        transition: TransitionState.Transition,
        value: Scale,
        idleValue: Scale,
    ): Scale {
        return Scale(scaleX, scaleY, pivot)
    }
+10 −10
Original line number Diff line number Diff line
@@ -33,37 +33,37 @@ internal class EdgeTranslate(
        content: ContentKey,
        element: ElementKey,
        transition: TransitionState.Transition,
        value: Offset,
        idleValue: Offset,
    ): Offset {
        val sceneSize =
            content.targetSize()
                ?: error("Content ${content.debugName} does not have a target size")
        val elementSize = element.targetSize(content) ?: return value
        val elementSize = element.targetSize(content) ?: return idleValue

        return when (edge.resolve(layoutDirection)) {
            Edge.Resolved.Top ->
                if (startsOutsideLayoutBounds) {
                    Offset(value.x, -elementSize.height.toFloat())
                    Offset(idleValue.x, -elementSize.height.toFloat())
                } else {
                    Offset(value.x, 0f)
                    Offset(idleValue.x, 0f)
                }
            Edge.Resolved.Left ->
                if (startsOutsideLayoutBounds) {
                    Offset(-elementSize.width.toFloat(), value.y)
                    Offset(-elementSize.width.toFloat(), idleValue.y)
                } else {
                    Offset(0f, value.y)
                    Offset(0f, idleValue.y)
                }
            Edge.Resolved.Bottom ->
                if (startsOutsideLayoutBounds) {
                    Offset(value.x, sceneSize.height.toFloat())
                    Offset(idleValue.x, sceneSize.height.toFloat())
                } else {
                    Offset(value.x, (sceneSize.height - elementSize.height).toFloat())
                    Offset(idleValue.x, (sceneSize.height - elementSize.height).toFloat())
                }
            Edge.Resolved.Right ->
                if (startsOutsideLayoutBounds) {
                    Offset(sceneSize.width.toFloat(), value.y)
                    Offset(sceneSize.width.toFloat(), idleValue.y)
                } else {
                    Offset((sceneSize.width - elementSize.width).toFloat(), value.y)
                    Offset((sceneSize.width - elementSize.width).toFloat(), idleValue.y)
                }
        }
    }
+1 −1
Original line number Diff line number Diff line
@@ -27,7 +27,7 @@ internal class Fade(override val matcher: ElementMatcher) : PropertyTransformati
        content: ContentKey,
        element: ElementKey,
        transition: TransitionState.Transition,
        value: Float,
        idleValue: Float,
    ): Float {
        // Return the alpha value of [element] either when it starts fading in or when it finished
        // fading out, which is `0` in both cases.
Loading