diff options
Diffstat (limited to 'src/com/android/launcher3/Utilities.java')
-rw-r--r-- | src/com/android/launcher3/Utilities.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Utilities.java b/src/com/android/launcher3/Utilities.java index 796fd2505..cc9bda710 100644 --- a/src/com/android/launcher3/Utilities.java +++ b/src/com/android/launcher3/Utilities.java @@ -61,6 +61,7 @@ import android.util.Pair; import android.util.TypedValue; import android.view.MotionEvent; import android.view.View; +import android.view.ViewConfiguration; import android.view.animation.Interpolator; import com.android.launcher3.compat.LauncherAppsCompat; @@ -726,6 +727,15 @@ public final class Utilities { return str.toString(); } + public static float squaredHypot(float x, float y) { + return x * x + y * y; + } + + public static float squaredTouchSlop(Context context) { + float slop = ViewConfiguration.get(context).getScaledTouchSlop(); + return slop * slop; + } + private static class FixedSizeEmptyDrawable extends ColorDrawable { private final int mSize; |