Loading packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt +34 −33 Original line number Diff line number Diff line Loading @@ -417,6 +417,7 @@ internal class SwipeAnimation<T : ContentKey>( // TODO(b/417444347): Use the default or fast spatial spec for small STLs, or make it a // parameter of the transitions spec. val animationSpec = spec ?: layoutState.motionScheme.slowSpatialSpec() val result = if ( willDecayReachBounds && willDecayFasterThanAnimating( Loading @@ -427,7 +428,7 @@ internal class SwipeAnimation<T : ContentKey>( initialVelocity, ) ) { val result = animatable.animateDecay(initialVelocity, decayAnimationSpec) animatable.animateDecay(initialVelocity, decayAnimationSpec).also { result -> check(animatable.value == targetOffset) { buildString { appendLine( Loading @@ -439,21 +440,21 @@ internal class SwipeAnimation<T : ContentKey>( appendLine(" decayOffset=$decayOffset") appendLine( " animateDecay result: reason=${result.endReason} " + "value=${result.endState.value} velocity=${result.endState.velocity}" "value=${result.endState.value} " + "velocity=${result.endState.velocity}" ) } } return initialVelocity - result.endState.velocity } } else { animatable.animateTo( targetValue = targetOffset, animationSpec = animationSpec, initialVelocity = initialVelocity, ) } // We consumed the whole velocity. return initialVelocity return initialVelocity - result.endState.velocity } private fun canChangeContent(targetContent: ContentKey): Boolean { Loading Loading
packages/SystemUI/compose/scene/src/com/android/compose/animation/scene/SwipeAnimation.kt +34 −33 Original line number Diff line number Diff line Loading @@ -417,6 +417,7 @@ internal class SwipeAnimation<T : ContentKey>( // TODO(b/417444347): Use the default or fast spatial spec for small STLs, or make it a // parameter of the transitions spec. val animationSpec = spec ?: layoutState.motionScheme.slowSpatialSpec() val result = if ( willDecayReachBounds && willDecayFasterThanAnimating( Loading @@ -427,7 +428,7 @@ internal class SwipeAnimation<T : ContentKey>( initialVelocity, ) ) { val result = animatable.animateDecay(initialVelocity, decayAnimationSpec) animatable.animateDecay(initialVelocity, decayAnimationSpec).also { result -> check(animatable.value == targetOffset) { buildString { appendLine( Loading @@ -439,21 +440,21 @@ internal class SwipeAnimation<T : ContentKey>( appendLine(" decayOffset=$decayOffset") appendLine( " animateDecay result: reason=${result.endReason} " + "value=${result.endState.value} velocity=${result.endState.velocity}" "value=${result.endState.value} " + "velocity=${result.endState.velocity}" ) } } return initialVelocity - result.endState.velocity } } else { animatable.animateTo( targetValue = targetOffset, animationSpec = animationSpec, initialVelocity = initialVelocity, ) } // We consumed the whole velocity. return initialVelocity return initialVelocity - result.endState.velocity } private fun canChangeContent(targetContent: ContentKey): Boolean { Loading