diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index 5aa39c425f..199c41a59e 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -191,6 +191,8 @@ public class CellLayout extends ViewGroup { mCountY = LauncherModel.getCellCountY(); mOccupied = new boolean[mCountX][mCountY]; mTmpOccupied = new boolean[mCountX][mCountY]; + mPreviousReorderDirection[0] = INVALID_DIRECTION; + mPreviousReorderDirection[1] = INVALID_DIRECTION; a.recycle(); @@ -1566,7 +1568,8 @@ public class CellLayout extends ViewGroup { float bestDistance = Float.MAX_VALUE; // We use this to march in a single direction - if (direction[0] != 0 && direction[1] != 0) { + if ((direction[0] != 0 && direction[1] != 0) || + (direction[0] == 0 && direction[1] == 0)) { return bestXY; }