diff options
Diffstat (limited to 'src/com/android/launcher3/DragLayer.java')
-rw-r--r-- | src/com/android/launcher3/DragLayer.java | 12 |
1 files changed, 7 insertions, 5 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); |