diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-05-09 20:35:17 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-09 20:35:17 +0000 |
commit | 2c0c746a00da4ffeb4feaf3908ded05201640e30 (patch) | |
tree | 7aee633c316756ada81843df3465db4d7404cce8 /src | |
parent | 07557e81a5a2dab455e724345095e2b4a32b7d17 (diff) | |
parent | aa6f66aad29171bda85e0633c93530beefdac307 (diff) | |
download | android_packages_apps_Trebuchet-2c0c746a00da4ffeb4feaf3908ded05201640e30.tar.gz android_packages_apps_Trebuchet-2c0c746a00da4ffeb4feaf3908ded05201640e30.tar.bz2 android_packages_apps_Trebuchet-2c0c746a00da4ffeb4feaf3908ded05201640e30.zip |
Fix bug where deep shortcut drag view target was skewed to the right.
am: aa6f66aad2
Change-Id: I87a99bfc52d7c8398099fc2230f02c0c7b6dee22
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 3 | ||||
-rw-r--r-- | src/com/android/launcher3/shortcuts/ShortcutsItemView.java | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index ead1a9f83..25e57495b 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -75,6 +75,7 @@ import com.android.launcher3.folder.FolderIcon; import com.android.launcher3.graphics.DragPreviewProvider; import com.android.launcher3.graphics.PreloadIconDrawable; import com.android.launcher3.popup.PopupContainerWithArrow; +import com.android.launcher3.shortcuts.ShortcutDragPreviewProvider; import com.android.launcher3.userevent.nano.LauncherLogProto.ContainerType; import com.android.launcher3.userevent.nano.LauncherLogProto.Target; import com.android.launcher3.util.ItemInfoMatcher; @@ -2262,6 +2263,8 @@ public class Workspace extends PagedView int previewSize = grid.folderIconSizePx; dragVisualizeOffset = new Point(- halfPadding, halfPadding - child.getPaddingTop()); dragRect = new Rect(0, child.getPaddingTop(), child.getWidth(), previewSize); + } else if (previewProvider instanceof ShortcutDragPreviewProvider) { + dragVisualizeOffset = new Point(- halfPadding, halfPadding); } // Clear the pressed state if necessary diff --git a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java index ee64b984a..a5c3120a5 100644 --- a/src/com/android/launcher3/shortcuts/ShortcutsItemView.java +++ b/src/com/android/launcher3/shortcuts/ShortcutsItemView.java @@ -109,7 +109,7 @@ public class ShortcutsItemView extends PopupItemView implements View.OnLongClick mIconShift.x = mIconLastTouchPos.x - sv.getIconCenter().x; mIconShift.y = mIconLastTouchPos.y - mLauncher.getDeviceProfile().iconSizePx; - DragView dv = mLauncher.getWorkspace().beginDragShared(sv.getBubbleText(), + DragView dv = mLauncher.getWorkspace().beginDragShared(sv.getIconView(), (PopupContainerWithArrow) getParent(), sv.getFinalInfo(), new ShortcutDragPreviewProvider(sv.getIconView(), mIconShift), new DragOptions()); dv.animateShift(-mIconShift.x, -mIconShift.y); |