summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-05-23 16:18:18 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-23 16:18:18 -0700
commit47bbf0d1d73bce72bca4fe1a419d636ed156410f (patch)
tree35bdd39db7fdbdff0df24cc2dfd2aa3c638781a6
parent388c546e474e64872dce492f1ee73fc0ba3b6d55 (diff)
parent56734d7e86fdd9c9a012f809d335749511361d55 (diff)
downloadandroid_packages_apps_Trebuchet-47bbf0d1d73bce72bca4fe1a419d636ed156410f.zip
android_packages_apps_Trebuchet-47bbf0d1d73bce72bca4fe1a419d636ed156410f.tar.gz
android_packages_apps_Trebuchet-47bbf0d1d73bce72bca4fe1a419d636ed156410f.tar.bz2
am 56734d7e: Merge "Fix issue with re-order animation not hinting the correct direction" into jb-dev
* commit '56734d7e86fdd9c9a012f809d335749511361d55': Fix issue with re-order animation not hinting the correct direction
-rw-r--r--src/com/android/launcher2/CellLayout.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 5591c9a..4837ddd 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -1942,13 +1942,15 @@ public class CellLayout extends ViewGroup {
if (dX == dY && dX == 0) {
} else {
if (dY == 0) {
- deltaX = mReorderHintAnimationMagnitude;
+ deltaX = - Math.signum(dX) * mReorderHintAnimationMagnitude;
} else if (dX == 0) {
- deltaY = mReorderHintAnimationMagnitude;
+ deltaY = - Math.signum(dY) * mReorderHintAnimationMagnitude;
} else {
double angle = Math.atan( (float) (dY) / dX);
- deltaX = (int) (Math.cos(angle) * mReorderHintAnimationMagnitude);
- deltaY = (int) (Math.sin(angle) * mReorderHintAnimationMagnitude);
+ deltaX = (int) (- Math.signum(dX) *
+ Math.abs(Math.cos(angle) * mReorderHintAnimationMagnitude));
+ deltaY = (int) (- Math.signum(dY) *
+ Math.abs(Math.sin(angle) * mReorderHintAnimationMagnitude));
}
}
child.setPivotY(child.getMeasuredHeight() * 0.5f);