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

Commit 6895c5ec authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Snap for 13310998 from 68b218bb to 25Q3-release

Change-Id: I37d9e99ce4813f93e8ae1d6ee2f813251b5065ef
parents a900c646 68b218bb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -11,5 +11,7 @@ checkstyle_hook = ${REPO_ROOT}/prebuilts/checkstyle/checkstyle.py --sha ${PREUPL

ktlint_hook = ${REPO_ROOT}/prebuilts/ktlint/ktlint.py --no-verify-format -f ${PREUPLOAD_FILES}

alint_hook =  ${REPO_ROOT}/vendor/google/tools/alint

[Tool Paths]
ktfmt = ${REPO_ROOT}/external/ktfmt/ktfmt.sh
+18 −16
Original line number Diff line number Diff line
@@ -376,7 +376,8 @@ private class ObservableComputations(
                    directMappedVelocity = 0f
                }

                var scheduleNextFrame = !isStable
                var scheduleNextFrame = false
                if (!isSameSegmentAndAtRest) {
                    if (capturedSegment != currentSegment) {
                        capturedSegment = currentSegment
                        scheduleNextFrame = true
@@ -396,6 +397,7 @@ private class ObservableComputations(
                        capturedSpringState = currentSpringState
                        scheduleNextFrame = true
                    }
                }

                if (capturedInput != currentInput) {
                    capturedInput = currentInput
+39 −6
Original line number Diff line number Diff line
@@ -423,22 +423,55 @@ internal interface ComputeSpringState : ComputeAnimation {
internal interface Computations : ComputeSpringState {
    val currentSpringState: SpringState

    val isSameSegmentAndAtRest: Boolean
        get() =
            lastAnimation.isAtRest &&
                lastSegment.spec == spec &&
                lastSegment.isValidForInput(currentInput, currentDirection)

    val currentDirectMapped: Float
        get() = currentSegment.mapping.map(currentInput) - currentAnimation.targetValue
        get() =
            if (isSameSegmentAndAtRest) {
                lastSegment.mapping.map(currentInput)
            } else {
                currentSegment.mapping.map(currentInput) - currentAnimation.targetValue
            }

    val currentAnimatedDelta: Float
        get() = currentAnimation.targetValue + currentSpringState.displacement
        get() =
            if (isSameSegmentAndAtRest) {
                0f
            } else {
                currentAnimation.targetValue + currentSpringState.displacement
            }

    val output: Float
        get() = currentDirectMapped + currentAnimatedDelta
        get() =
            if (isSameSegmentAndAtRest) {
                lastSegment.mapping.map(currentInput)
            } else {
                currentDirectMapped + currentAnimatedDelta
            }

    val outputTarget: Float
        get() = currentDirectMapped + currentAnimation.targetValue
        get() =
            if (isSameSegmentAndAtRest) {
                lastAnimation.targetValue
            } else {
                currentDirectMapped + currentAnimation.targetValue
            }

    val isStable: Boolean
        get() = currentSpringState == SpringState.AtRest
        get() =
            if (isSameSegmentAndAtRest) {
                true
            } else {
                currentSpringState == SpringState.AtRest
            }

    fun <T> semanticState(semanticKey: SemanticKey<T>): T? {
        return with(currentSegment) { spec.semanticState(semanticKey, key) }
        return with(if (isSameSegmentAndAtRest) lastSegment else currentSegment) {
            spec.semanticState(semanticKey, key)
        }
    }
}
+6 −4
Original line number Diff line number Diff line
@@ -277,10 +277,12 @@ private class ImperativeComputations(

        currentAnimationTimeNanos = frameTimeMillis * 1_000_000L

        if (!isSameSegmentAndAtRest) {
            currentSegment = computeCurrentSegment()
            currentGuaranteeState = computeCurrentGuaranteeState()
            currentAnimation = computeCurrentAnimation()
            currentSpringState = computeCurrentSpringState()
        }

        debugInspector?.run {
            frame =