mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Remove usage of FloatMath
Bug: https://code.google.com/p/android/issues/detail?id=36199 Change-Id: I2effc3f498fb13e66de9a905b9a40ac5688a5850
This commit is contained in:
@@ -21,7 +21,6 @@ import android.graphics.Matrix;
|
||||
import android.graphics.Point;
|
||||
import android.graphics.RectF;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.FloatMath;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.ScaleGestureDetector;
|
||||
import android.view.ScaleGestureDetector.OnScaleGestureListener;
|
||||
@@ -300,12 +299,12 @@ public class CropView extends TiledImageView implements OnScaleGestureListener {
|
||||
adjustment[0] = (edges.right - getWidth()) / scale;
|
||||
}
|
||||
if (edges.top > 0) {
|
||||
adjustment[1] = FloatMath.ceil(edges.top / scale);
|
||||
adjustment[1] = (float) Math.ceil(edges.top / scale);
|
||||
} else if (edges.bottom < getHeight()) {
|
||||
adjustment[1] = (edges.bottom - getHeight()) / scale;
|
||||
}
|
||||
for (int dim = 0; dim <= 1; dim++) {
|
||||
if (coef[dim] > 0) adjustment[dim] = FloatMath.ceil(adjustment[dim]);
|
||||
if (coef[dim] > 0) adjustment[dim] = (float) Math.ceil(adjustment[dim]);
|
||||
}
|
||||
|
||||
mInverseRotateMatrix.mapPoints(adjustment);
|
||||
|
||||
@@ -20,7 +20,6 @@ import android.animation.TimeInterpolator;
|
||||
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;
|
||||
@@ -409,7 +408,7 @@ public class LauncherScroller {
|
||||
|
||||
float dx = (float) (mFinalX - mStartX);
|
||||
float dy = (float) (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;
|
||||
@@ -426,7 +425,7 @@ public class LauncherScroller {
|
||||
mMode = FLING_MODE;
|
||||
mFinished = false;
|
||||
|
||||
float velocity = FloatMath.sqrt(velocityX * velocityX + velocityY * velocityY);
|
||||
float velocity = (float) Math.hypot(velocityX, velocityY);
|
||||
|
||||
mVelocity = velocity;
|
||||
mDuration = getSplineFlingDuration(velocity);
|
||||
|
||||
Reference in New Issue
Block a user