summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Fuller <nfuller@google.com>2014-10-02 16:36:27 +0100
committerNeil Fuller <nfuller@google.com>2014-10-02 16:37:40 +0100
commite8fe6683e29d30e8dcc92c87773625ae708ddca8 (patch)
treead4f4da432396d092835833d67f712d9800edc8c
parentb0e357d548fb8d10896200add2b932199a96a2ea (diff)
downloadCamera-e8fe6683e29d30e8dcc92c87773625ae708ddca8.tar.gz
Remove dependencies on FloatMath
See frameworks/base commit 33253a4baa6279f81a73425b49dfb6abe5f5416e for details. Bug: https://code.google.com/p/android/issues/detail?id=36199 Change-Id: I752c66ae8d5470686780cb55c43ce7da4aa042f1
-rw-r--r--src/com/android/camera/CameraSettings.java5
-rw-r--r--src/com/android/camera/Util.java3
-rw-r--r--src/com/android/camera/ui/PieRenderer.java2
3 files changed, 4 insertions, 6 deletions
diff --git a/src/com/android/camera/CameraSettings.java b/src/com/android/camera/CameraSettings.java
index 3bc58a03..e71cba1d 100644
--- a/src/com/android/camera/CameraSettings.java
+++ b/src/com/android/camera/CameraSettings.java
@@ -27,7 +27,6 @@ import android.hardware.Camera.CameraInfo;
import android.hardware.Camera.Parameters;
import android.hardware.Camera.Size;
import android.media.CamcorderProfile;
-import android.util.FloatMath;
import android.util.Log;
import com.android.gallery3d.common.ApiHelper;
@@ -243,8 +242,8 @@ public class CameraSettings {
float step = mParameters.getExposureCompensationStep();
// show only integer values for exposure compensation
- int maxValue = (int) FloatMath.floor(max * step);
- int minValue = (int) FloatMath.ceil(min * step);
+ int maxValue = (int) Math.floor(max * step);
+ int minValue = (int) Math.ceil(min * step);
CharSequence entries[] = new CharSequence[maxValue - minValue + 1];
CharSequence entryValues[] = new CharSequence[maxValue - minValue + 1];
int[] icons = new int[maxValue - minValue + 1];
diff --git a/src/com/android/camera/Util.java b/src/com/android/camera/Util.java
index 2953d6ae..163e08a7 100644
--- a/src/com/android/camera/Util.java
+++ b/src/com/android/camera/Util.java
@@ -41,7 +41,6 @@ import android.os.Build;
import android.os.ParcelFileDescriptor;
import android.telephony.TelephonyManager;
import android.util.DisplayMetrics;
-import android.util.FloatMath;
import android.util.Log;
import android.util.TypedValue;
import android.view.Display;
@@ -365,7 +364,7 @@ public class Util {
public static float distance(float x, float y, float sx, float sy) {
float dx = x - sx;
float dy = y - sy;
- return FloatMath.sqrt(dx * dx + dy * dy);
+ return (float) Math.hypot(dx, dy);
}
public static int clamp(int x, int min, int max) {
diff --git a/src/com/android/camera/ui/PieRenderer.java b/src/com/android/camera/ui/PieRenderer.java
index b592508e..a424d19e 100644
--- a/src/com/android/camera/ui/PieRenderer.java
+++ b/src/com/android/camera/ui/PieRenderer.java
@@ -554,7 +554,7 @@ public class PieRenderer extends OverlayRenderer
res.x = (float) Math.PI / 2;
x = x - mCenter.x;
y = mCenter.y - y;
- res.y = (float) Math.sqrt(x * x + y * y);
+ res.y = (float) Math.hypot(x, y);
if (x != 0) {
res.x = (float) Math.atan2(y, x);
if (res.x < 0) {