diff options
author | Adam Cohen <adamcohen@google.com> | 2013-10-15 14:34:05 -0700 |
---|---|---|
committer | Adam Cohen <adamcohen@google.com> | 2013-10-15 16:13:28 -0700 |
commit | 28f852ab678d9750879b6d3549bf5da176cf1225 (patch) | |
tree | 75334902d5d0fa83f6b403f8fa0537d729c211e6 /src/com/android | |
parent | edc43805e3d65608b39d9271aee97e45904d85dd (diff) | |
download | android_packages_apps_Trebuchet-28f852ab678d9750879b6d3549bf5da176cf1225.tar.gz android_packages_apps_Trebuchet-28f852ab678d9750879b6d3549bf5da176cf1225.tar.bz2 android_packages_apps_Trebuchet-28f852ab678d9750879b6d3549bf5da176cf1225.zip |
Fix drop animation issue in springloaded
Change-Id: I1d8bf9d92ab7b94238e3e6a27b0eebf2c9af6872
Diffstat (limited to 'src/com/android')
-rw-r--r-- | src/com/android/launcher3/DragLayer.java | 12 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 2 |
2 files changed, 8 insertions, 6 deletions
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java index 89f8275bf..159d7d992 100644 --- a/src/com/android/launcher3/DragLayer.java +++ b/src/com/android/launcher3/DragLayer.java @@ -480,7 +480,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang } public void animateViewIntoPosition(DragView dragView, final View child) { - animateViewIntoPosition(dragView, child, null); + animateViewIntoPosition(dragView, child, null, null); } public void animateViewIntoPosition(DragView dragView, final int[] pos, float alpha, @@ -496,8 +496,8 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang } public void animateViewIntoPosition(DragView dragView, final View child, - final Runnable onFinishAnimationRunnable) { - animateViewIntoPosition(dragView, child, -1, onFinishAnimationRunnable, null); + final Runnable onFinishAnimationRunnable, View anchorView) { + animateViewIntoPosition(dragView, child, -1, onFinishAnimationRunnable, anchorView); } public void animateViewIntoPosition(DragView dragView, final View child, int duration, @@ -645,8 +645,10 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang int x = (int) (fromLeft + Math.round(((to.left - fromLeft) * motionPercent))); int y = (int) (fromTop + Math.round(((to.top - fromTop) * motionPercent))); - int xPos = x - mDropView.getScrollX() + (mAnchorView != null - ? (mAnchorViewInitialScrollX - mAnchorView.getScrollX()) : 0); + int anchorAdjust = mAnchorView == null ? 0 : (int) (mAnchorView.getScaleX() * + (mAnchorViewInitialScrollX - mAnchorView.getScrollX())); + + int xPos = x - mDropView.getScrollX() + anchorAdjust; int yPos = y - mDropView.getScrollY(); mDropView.setTranslationX(xPos); diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index 908a61ea4..d2d1254ed 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -3654,7 +3654,7 @@ public class Workspace extends SmoothPagedView // the correct final location. setFinalTransitionTransform(cellLayout); mLauncher.getDragLayer().animateViewIntoPosition(d.dragView, view, - exitSpringLoadedRunnable); + exitSpringLoadedRunnable, this); resetTransitionTransform(cellLayout); } } |