[go: nahoru, domu]

Remove early return from updateInitialAndTargetValue

This is a temporary workaround while we don't figure out why the Animation
Preview does not work properly when we have the early return in place.

Bug: 178811102
Test: Checked on Android Studio Compose Animation Preview
Change-Id: Ic246c80a977685a62242d42905d15c25e668228b
diff --git a/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Transition.kt b/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Transition.kt
index fb21aa8..21fff8f4 100644
--- a/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Transition.kt
+++ b/compose/animation/animation-core/src/commonMain/kotlin/androidx/compose/animation/core/Transition.kt
@@ -425,11 +425,12 @@
         }
 
         @PublishedApi
+        @Suppress("ControlFlowWithEmptyBody")
         // This gets called *during* composition
         internal fun updateInitialAndTargetValue(initialValue: T, targetValue: T) {
             this.targetValue = targetValue
             if (animation.initialValue == initialValue && animation.targetValue == targetValue) {
-                return
+                // TODO(b/178811102): we should be able to return early here.
             }
             updateAnimation(initialValue)
         }