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

Commit 8e2189dc authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Add better information for invalid path

Test: Fling shade
Bug: 120200303
Change-Id: Id2ca27e059c58471e6f0cd262a04d19c42afe348
parent 13bb7628
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -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;
        }