Clean mPreviousSolution on change of CellLayout target

The previous reorder solution is not peropperly cleaned and
that leads to wrong solution being used. For example when
longpressing an icon, it triggers a drag but the drag never
finishes.

Fix: 261122618
Test: You can no longer overlap a shortcut in the same app icon (see attached bug)
Test: atest ReorderWidget

Change-Id: Iff8651926cc4179561761c7ce0ac5007f13fc9af
This commit is contained in:
Sebastian Franco committed 2022-12-14 15:20:50 -06:00
1 parent c995ec1dd8
commit 5aa71cee20
1 file changed
+2
@@ -2716,6 +2716,7 @@ public class CellLayout extends ViewGroup {
*/
void onDragEnter() {
mDragging = true;
mPreviousSolution = null;
}
/**
@@ -2730,6 +2731,7 @@ public class CellLayout extends ViewGroup {
}
// Invalidate the drag data
mPreviousSolution = null;
mDragCell[0] = mDragCell[1] = -1;
mDragCellSpan[0] = mDragCellSpan[1] = -1;
mDragOutlineAnims[mDragOutlineCurrent].animateOut();