From 53989971bfddd3ec2db4160858d58c4f679f0749 Mon Sep 17 00:00:00 2001 From: Adrian Roos Date: Thu, 19 Mar 2020 20:15:57 +0100 Subject: WindowInsetsAnimationController: Fix minor API issues - make sure we only dispatch the controller in onCancelled after the app has seen onReady - return a linearly interpolated getFraction() if there is no interpolator instead of -1 Bug: 118118435 Test: atest WindowInsetsAnimationControllerTests Change-Id: Iccd0b6246b4cdc250f3111409821c1dac53c694e --- core/java/android/view/WindowInsetsAnimation.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/java/android/view/WindowInsetsAnimation.java') diff --git a/core/java/android/view/WindowInsetsAnimation.java b/core/java/android/view/WindowInsetsAnimation.java index e32648809f8f..cf5e7e3d3e26 100644 --- a/core/java/android/view/WindowInsetsAnimation.java +++ b/core/java/android/view/WindowInsetsAnimation.java @@ -110,14 +110,13 @@ public final class WindowInsetsAnimation { * and 1. *

* @see #getFraction() for raw fraction. - * @return The current interpolated progress of this animation. -1 if interpolator isn't - * specified. + * @return The current interpolated progress of this animation. */ public float getInterpolatedFraction() { if (mInterpolator != null) { return mInterpolator.getInterpolation(mFraction); } - return -1; + return mFraction; } /** -- cgit v1.2.3