summaryrefslogtreecommitdiffstats
path: root/gallerycommon/src/com/android/gallery3d/common/Scroller.java
diff options
context:
space:
mode:
Diffstat (limited to 'gallerycommon/src/com/android/gallery3d/common/Scroller.java')
-rw-r--r--gallerycommon/src/com/android/gallery3d/common/Scroller.java5
1 files changed, 2 insertions, 3 deletions
diff --git a/gallerycommon/src/com/android/gallery3d/common/Scroller.java b/gallerycommon/src/com/android/gallery3d/common/Scroller.java
index 6cefd6fb0..cce0c9284 100644
--- a/gallerycommon/src/com/android/gallery3d/common/Scroller.java
+++ b/gallerycommon/src/com/android/gallery3d/common/Scroller.java
@@ -19,7 +19,6 @@ package com.android.gallery3d.common;
import android.content.Context;
import android.hardware.SensorManager;
import android.os.Build;
-import android.util.FloatMath;
import android.view.ViewConfiguration;
import android.view.animation.AnimationUtils;
import android.view.animation.Interpolator;
@@ -372,7 +371,7 @@ public class Scroller {
float dx = mFinalX - mStartX;
float dy = mFinalY - mStartY;
- float hyp = FloatMath.sqrt(dx * dx + dy * dy);
+ float hyp = (float) Math.hypot(dx, dy);
float ndx = dx / hyp;
float ndy = dy / hyp;
@@ -389,7 +388,7 @@ public class Scroller {
mMode = FLING_MODE;
mFinished = false;
- float velocity = FloatMath.sqrt(velocityX * velocityX + velocityY * velocityY);
+ float velocity = (float) Math.hypot(velocityX, velocityY);
mVelocity = velocity;
final double l = Math.log(START_TENSION * velocity / ALPHA);