summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2015-11-06 18:10:05 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-11-06 18:10:05 +0000
commit0e2f3849b84f59ed7c1c4336ca01ac17f096e265 (patch)
tree5e48fddd2f1b92e2368db5154f4a8f2b10ea5207 /src/com/android/launcher3/util
parent0f6f2b181fcf28887b343226cef3b263a65621cd (diff)
parentc2964cb6cd87746dd1e44da90e62813ccb47cecf (diff)
downloadandroid_packages_apps_Trebuchet-0e2f3849b84f59ed7c1c4336ca01ac17f096e265.tar.gz
android_packages_apps_Trebuchet-0e2f3849b84f59ed7c1c4336ca01ac17f096e265.tar.bz2
android_packages_apps_Trebuchet-0e2f3849b84f59ed7c1c4336ca01ac17f096e265.zip
Merge "Make sure user can always get to next page with keyboard." into ub-launcher3-burnaby-polish
Diffstat (limited to 'src/com/android/launcher3/util')
-rw-r--r--src/com/android/launcher3/util/FocusLogic.java12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/com/android/launcher3/util/FocusLogic.java b/src/com/android/launcher3/util/FocusLogic.java
index ba44f008a..2aae3c089 100644
--- a/src/com/android/launcher3/util/FocusLogic.java
+++ b/src/com/android/launcher3/util/FocusLogic.java
@@ -346,6 +346,18 @@ public class FocusLogic {
}
}
}
+
+ // Rule 3: if switching between pages, do a brute-force search to find an item that was
+ // missed by rules 1 and 2 (such as when going from a bottom right icon to top left)
+ if (iconIdx == PIVOT) {
+ for (int x = xPos + increment; 0 <= x && x < cntX; x = x + increment) {
+ for (int y = 0; y < cntY; y++) {
+ if ((newIconIndex = inspectMatrix(x, y, cntX, cntY, matrix)) != NOOP) {
+ return newIconIndex;
+ }
+ }
+ }
+ }
return newIconIndex;
}