summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAdam Cohen <adamcohen@google.com>2012-03-22 15:13:40 -0700
committerAdam Cohen <adamcohen@google.com>2012-03-22 15:15:38 -0700
commit6b8a02d63a5d9cab8209381993e37db6a6afb753 (patch)
tree36742358cfb293186ca7780a7ad1f224b6f318ec /src
parent8baab35b000d2dec9b33ea6a67988b6f0185b27e (diff)
downloadandroid_packages_apps_Trebuchet-6b8a02d63a5d9cab8209381993e37db6a6afb753.tar.gz
android_packages_apps_Trebuchet-6b8a02d63a5d9cab8209381993e37db6a6afb753.tar.bz2
android_packages_apps_Trebuchet-6b8a02d63a5d9cab8209381993e37db6a6afb753.zip
Fixing animation bug for reordering
Change-Id: Ibb8f53a9beb2ddcacab93507fe7469639e0e0587
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher2/CellLayout.java7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java
index 8dc43d17f..3b77f352e 100644
--- a/src/com/android/launcher2/CellLayout.java
+++ b/src/com/android/launcher2/CellLayout.java
@@ -1101,8 +1101,9 @@ public class CellLayout extends ViewGroup {
@Override
public void onAnimationUpdate(ValueAnimator animation) {
float r = ((Float) animation.getAnimatedValue()).floatValue();
- child.setTranslationX(r * (newX - oldX));
- child.setTranslationY(r * (newY - oldY));
+ lp.x = (int) (r * newX + (1 - r) * oldX);
+ lp.y = (int) (r * newY + (1 - r) * oldY);
+ child.requestLayout();
}
});
va.addListener(new AnimatorListenerAdapter() {
@@ -1112,8 +1113,6 @@ public class CellLayout extends ViewGroup {
// has interrupted this one, and we don't want to lock the item into
// place just yet.
if (!cancelled) {
- child.setTranslationX(0);
- child.setTranslationY(0);
lp.isLockedToGrid = true;
child.requestLayout();
}