diff options
| author | Neil Fuller <nfuller@google.com> | 2015-02-12 10:00:41 +0000 |
|---|---|---|
| committer | android-build-merger <android-build-merger@google.com> | 2015-02-12 10:00:41 +0000 |
| commit | c1a5e82c25dba954cf1c06729e53bfb67667bcbb (patch) | |
| tree | 51cc67eb0b014b6a42514c1a0516a49b1b48e4a8 /core/java/android/transition/CircularPropagation.java | |
| parent | 6d8886ac46106bda18b26a0870ed144f225c560f (diff) | |
| parent | 27316a93e5979859ae98f506eca365784353007a (diff) | |
| download | frameworks_base-c1a5e82c25dba954cf1c06729e53bfb67667bcbb.zip frameworks_base-c1a5e82c25dba954cf1c06729e53bfb67667bcbb.tar.gz frameworks_base-c1a5e82c25dba954cf1c06729e53bfb67667bcbb.tar.bz2 | |
Merge "Remove usages of FloatMath" automerge: a8e8cdb
automerge: 27316a9
* commit '27316a93e5979859ae98f506eca365784353007a':
Remove usages of FloatMath
Diffstat (limited to 'core/java/android/transition/CircularPropagation.java')
| -rw-r--r-- | core/java/android/transition/CircularPropagation.java | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/core/java/android/transition/CircularPropagation.java b/core/java/android/transition/CircularPropagation.java index 51beb51..1e44cfa 100644 --- a/core/java/android/transition/CircularPropagation.java +++ b/core/java/android/transition/CircularPropagation.java @@ -16,7 +16,6 @@ package android.transition; import android.graphics.Rect; -import android.util.FloatMath; import android.util.Log; import android.view.View; import android.view.ViewGroup; @@ -87,9 +86,9 @@ public class CircularPropagation extends VisibilityPropagation { epicenterY = Math.round(loc[1] + (sceneRoot.getHeight() / 2) + sceneRoot.getTranslationY()); } - float distance = distance(viewCenterX, viewCenterY, epicenterX, epicenterY); - float maxDistance = distance(0, 0, sceneRoot.getWidth(), sceneRoot.getHeight()); - float distanceFraction = distance/maxDistance; + double distance = distance(viewCenterX, viewCenterY, epicenterX, epicenterY); + double maxDistance = distance(0, 0, sceneRoot.getWidth(), sceneRoot.getHeight()); + double distanceFraction = distance/maxDistance; long duration = transition.getDuration(); if (duration < 0) { @@ -99,9 +98,9 @@ public class CircularPropagation extends VisibilityPropagation { return Math.round(duration * directionMultiplier / mPropagationSpeed * distanceFraction); } - private static float distance(float x1, float y1, float x2, float y2) { - float x = x2 - x1; - float y = y2 - y1; - return FloatMath.sqrt((x * x) + (y * y)); + private static double distance(float x1, float y1, float x2, float y2) { + double x = x2 - x1; + double y = y2 - y1; + return Math.hypot(x, y); } } |
