Merge "Add better information for invalid path"
This commit is contained in:
committed by
Android (Google) Code Review
commit
455b60fe2e
@@ -18,12 +18,14 @@ package com.android.systemui.statusbar;
|
||||
|
||||
import android.animation.Animator;
|
||||
import android.content.Context;
|
||||
import android.util.Log;
|
||||
import android.view.ViewPropertyAnimator;
|
||||
import android.view.animation.Interpolator;
|
||||
import android.view.animation.PathInterpolator;
|
||||
|
||||
import com.android.systemui.Interpolators;
|
||||
import com.android.systemui.statusbar.notification.NotificationUtils;
|
||||
import com.android.systemui.statusbar.phone.StatusBar;
|
||||
|
||||
/**
|
||||
* Utility class to calculate general fling animation when the finger is released.
|
||||
@@ -196,9 +198,16 @@ public class FlingAnimationUtils {
|
||||
if (startGradient != mCachedStartGradient
|
||||
|| velocityFactor != mCachedVelocityFactor) {
|
||||
float speedup = mSpeedUpFactor * (1.0f - velocityFactor);
|
||||
mInterpolator = new PathInterpolator(speedup,
|
||||
speedup * startGradient,
|
||||
mLinearOutSlowInX2, mY2);
|
||||
float x1 = speedup;
|
||||
float y1 = speedup * startGradient;
|
||||
float x2 = mLinearOutSlowInX2;
|
||||
float y2 = mY2;
|
||||
try {
|
||||
mInterpolator = new PathInterpolator(x1, y1, x2, y2);
|
||||
} catch (IllegalArgumentException e) {
|
||||
throw new IllegalArgumentException("Illegal path with "
|
||||
+ "x1=" + x1 + " y1=" + y1 + " x2=" + x2 + " y2=" + y2, e);
|
||||
}
|
||||
mCachedStartGradient = startGradient;
|
||||
mCachedVelocityFactor = velocityFactor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user