diff options
author | Mario Bertschler <bmario@google.com> | 2018-03-06 14:49:01 -0800 |
---|---|---|
committer | Mario Bertschler <bmario@google.com> | 2018-03-06 14:49:01 -0800 |
commit | 3d73e7aac7bd0c5eb4bd7dcb7ec6baa79c58f17f (patch) | |
tree | bef49d57be34dff1defd034c449c8bc9fe0726bc /src/com/android/launcher3 | |
parent | 46d259d9fb7b918ee5fee773ee615dd9111aa89f (diff) | |
download | android_packages_apps_Trebuchet-3d73e7aac7bd0c5eb4bd7dcb7ec6baa79c58f17f.tar.gz android_packages_apps_Trebuchet-3d73e7aac7bd0c5eb4bd7dcb7ec6baa79c58f17f.tar.bz2 android_packages_apps_Trebuchet-3d73e7aac7bd0c5eb4bd7dcb7ec6baa79c58f17f.zip |
Check in FocusLogic that focused view fits into the matrix created for
cell-layout. Temporarily there can be a mismatch.
Bug: 73346286
Change-Id: Id014332d585c73b2be92da1f24db82484f103de4
Diffstat (limited to 'src/com/android/launcher3')
-rw-r--r-- | src/com/android/launcher3/util/FocusLogic.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/com/android/launcher3/util/FocusLogic.java b/src/com/android/launcher3/util/FocusLogic.java index b80e94d15..b793f5481 100644 --- a/src/com/android/launcher3/util/FocusLogic.java +++ b/src/com/android/launcher3/util/FocusLogic.java @@ -177,7 +177,10 @@ public class FocusLogic { } int cx = ((CellLayout.LayoutParams) cell.getLayoutParams()).cellX; int cy = ((CellLayout.LayoutParams) cell.getLayoutParams()).cellY; - matrix[invert ? (m - cx - 1) : cx][cy] = i; + int x = invert ? (m - cx - 1) : cx; + if (x < m && cy < n) { // check if view fits into matrix, else skip + matrix[x][cy] = i; + } } if (DEBUG) { printMatrix(matrix); |