diff options
author | Adam Cohen <adamcohen@google.com> | 2012-03-29 14:30:35 -0700 |
---|---|---|
committer | Winson Chung <winsonc@google.com> | 2012-03-29 15:02:54 -0700 |
commit | 5b53f29f809a0dad4a1e0717ba610ce737ee0f43 (patch) | |
tree | 29518abba7ec4b23b79c43f5e892893b5bf8de23 /src/com/android/launcher2/CellLayout.java | |
parent | 4b57851287a8806cad6f836e24c5b835a48c22a9 (diff) | |
download | android_packages_apps_Trebuchet-5b53f29f809a0dad4a1e0717ba610ce737ee0f43.tar.gz android_packages_apps_Trebuchet-5b53f29f809a0dad4a1e0717ba610ce737ee0f43.tar.bz2 android_packages_apps_Trebuchet-5b53f29f809a0dad4a1e0717ba610ce737ee0f43.zip |
Fixing launcher ANR (issue 6238175)
Change-Id: I6518ea9e6ce8b50a5f2a3b24e909e18c5b1bde51
Diffstat (limited to 'src/com/android/launcher2/CellLayout.java')
-rw-r--r-- | src/com/android/launcher2/CellLayout.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher2/CellLayout.java b/src/com/android/launcher2/CellLayout.java index fb319fe0c..79d8dc534 100644 --- a/src/com/android/launcher2/CellLayout.java +++ b/src/com/android/launcher2/CellLayout.java @@ -189,6 +189,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(); @@ -1564,7 +1566,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; } |