diff options
author | Tony Wickham <twickham@google.com> | 2016-10-19 16:48:43 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-10-19 16:48:43 +0000 |
commit | 1da143940c7bed541aef0f840d295427f9397ca3 (patch) | |
tree | ee929d698af719f501c3470fc2621efb0594516f | |
parent | d164b7f4abcba6cc965c2264257569f88ad5e4a5 (diff) | |
parent | 4e47b5b0d678f9b23bee211a7808c73c51a1d7d1 (diff) | |
download | android_packages_apps_Trebuchet-1da143940c7bed541aef0f840d295427f9397ca3.tar.gz android_packages_apps_Trebuchet-1da143940c7bed541aef0f840d295427f9397ca3.tar.bz2 android_packages_apps_Trebuchet-1da143940c7bed541aef0f840d295427f9397ca3.zip |
Merge "Mark cells as unoccupied in onDragStart instead of startDrag." into ub-launcher3-master
-rw-r--r-- | src/com/android/launcher3/CellLayout.java | 4 | ||||
-rw-r--r-- | src/com/android/launcher3/Workspace.java | 11 |
2 files changed, 7 insertions, 8 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java index 1bcf39f45..5c7ea767c 100644 --- a/src/com/android/launcher3/CellLayout.java +++ b/src/com/android/launcher3/CellLayout.java @@ -2215,10 +2215,6 @@ public class CellLayout extends ViewGroup implements BubbleTextShadowHandler { return solution; } - public void prepareChildForDrag(View child) { - markCellsAsUnoccupiedForView(child); - } - /* This seems like it should be obvious and straight-forward, but when the direction vector needs to match with the notion of the dragView pushing other views, we have to employ a slightly more subtle notion of the direction vector. The question is what two points is diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java index f6f98d788..ae3463820 100644 --- a/src/com/android/launcher3/Workspace.java +++ b/src/com/android/launcher3/Workspace.java @@ -411,6 +411,11 @@ public class Workspace extends PagedView enforceDragParity("onDragStart", 0, 0); } + if (mDragInfo != null && mDragInfo.cell != null) { + CellLayout layout = (CellLayout) mDragInfo.cell.getParent().getParent(); + layout.markCellsAsUnoccupiedForView(mDragInfo.cell); + } + if (mOutlineProvider != null) { // The outline is used to visualize where the item will land if dropped mOutlineProvider.generateDragOutline(mCanvas); @@ -478,6 +483,8 @@ public class Workspace extends PagedView // Re-enable any Un/InstallShortcutReceiver and now process any queued items InstallShortcutReceiver.disableAndFlushInstallQueue(getContext()); + mOutlineProvider = null; + mDragInfo = null; mDragSourceInternal = null; mLauncher.onInteractionEnd(); } @@ -2245,8 +2252,6 @@ public class Workspace extends PagedView mDragInfo = cellInfo; child.setVisibility(INVISIBLE); - CellLayout layout = (CellLayout) child.getParent().getParent(); - layout.prepareChildForDrag(child); if (options.isAccessibleDrag) { mDragController.addDragListener(new AccessibleDragListenerAdapter( @@ -3680,8 +3685,6 @@ public class Workspace extends PagedView && mDragInfo.cell != null) { mDragInfo.cell.setVisibility(VISIBLE); } - mOutlineProvider = null; - mDragInfo = null; if (!isFlingToDelete) { // Fling to delete already exits spring loaded mode after the animation finishes. |