diff options
author | Winson Chung <winsonc@google.com> | 2013-11-15 10:22:01 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-11-15 10:22:01 -0800 |
commit | 3a7bea59817342575cb8cba7c3307dc7b3c159e1 (patch) | |
tree | d12eb3a270e15608817fb15a1551adeaea266eff /src/com/android/launcher3/DragLayer.java | |
parent | b6186d2bbe32405dcee7bb83f0a516fa1732e84a (diff) | |
parent | 89ee93e0f8b6ac1ed6aefc2b940d1606f2027491 (diff) | |
download | android_packages_apps_Trebuchet-3a7bea59817342575cb8cba7c3307dc7b3c159e1.tar.gz android_packages_apps_Trebuchet-3a7bea59817342575cb8cba7c3307dc7b3c159e1.tar.bz2 android_packages_apps_Trebuchet-3a7bea59817342575cb8cba7c3307dc7b3c159e1.zip |
am 89ee93e0: Merge "Use the icon bounds for all calculations." into jb-ub-now-jolly-elf
* commit '89ee93e0f8b6ac1ed6aefc2b940d1606f2027491':
Use the icon bounds for all calculations.
Diffstat (limited to 'src/com/android/launcher3/DragLayer.java')
-rw-r--r-- | src/com/android/launcher3/DragLayer.java | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/com/android/launcher3/DragLayer.java b/src/com/android/launcher3/DragLayer.java index 303bddf77..56886a19c 100644 --- a/src/com/android/launcher3/DragLayer.java +++ b/src/com/android/launcher3/DragLayer.java @@ -534,14 +534,18 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang scale *= childScale; int toX = coord[0]; int toY = coord[1]; + float toScale = scale; if (child instanceof TextView) { TextView tv = (TextView) child; + // Account for the source scale of the icon (ie. from AllApps to Workspace, in which + // the workspace may have smaller icon bounds). + toScale = scale / dragView.getIntrinsicIconScaleFactor(); // The child may be scaled (always about the center of the view) so to account for it, // we have to offset the position by the scaled size. Once we do that, we can center // the drag view about the scaled child view. - toY += Math.round(scale * tv.getPaddingTop()); - toY -= dragView.getMeasuredHeight() * (1 - scale) / 2; + toY += Math.round(toScale * tv.getPaddingTop()); + toY -= dragView.getMeasuredHeight() * (1 - toScale) / 2; toX -= (dragView.getMeasuredWidth() - Math.round(scale * child.getMeasuredWidth())) / 2; } else if (child instanceof FolderIcon) { // Account for holographic blur padding on the drag view @@ -567,7 +571,7 @@ public class DragLayer extends FrameLayout implements ViewGroup.OnHierarchyChang } } }; - animateViewIntoPosition(dragView, fromX, fromY, toX, toY, 1, 1, 1, scale, scale, + animateViewIntoPosition(dragView, fromX, fromY, toX, toY, 1, 1, 1, toScale, toScale, onCompleteRunnable, ANIMATION_END_DISAPPEAR, duration, anchorView); } |