[key event focus handling] (1)hotseat <-> icon now symmetric, (2)support DEL keycode
TL;DR; (1) Key event navigation from and to the hotseat and icons in the workspace
is now symmetric. Since there is one more icon in the hotseat, only left
N-1 icon navigation was symmetric.
(2) KeyEvent.KEYCODE_DEL and KeyEvent.KEYCODE_FORWARD_DEL can now delete icons
from the workspace. The focus move to the previous icon where the focus
traveled from.
Also contains minor styling and indexing issues.
Bug: 15408321
Bug: 19381790
Change-Id: I16cbcb2693e92eebb830997d01c0bf674073dd51
diff --git a/src/com/android/launcher3/Hotseat.java b/src/com/android/launcher3/Hotseat.java
index 289b08b..bd6c21a 100644
--- a/src/com/android/launcher3/Hotseat.java
+++ b/src/com/android/launcher3/Hotseat.java
@@ -83,13 +83,24 @@
int getOrderInHotseat(int x, int y) {
return hasVerticalHotseat() ? (mContent.getCountY() - y - 1) : x;
}
+
/* Get the orientation specific coordinates given an invariant order in the hotseat. */
int getCellXFromOrder(int rank) {
return hasVerticalHotseat() ? 0 : rank;
}
+
int getCellYFromOrder(int rank) {
return hasVerticalHotseat() ? (mContent.getCountY() - (rank + 1)) : 0;
}
+
+ public int getAllAppsButtonRank() {
+ if (LauncherAppState.isDisableAllApps()) {
+ return -1;
+ } else {
+ return mAllAppsButtonRank;
+ }
+ }
+
public boolean isAllAppsButtonRank(int rank) {
if (LauncherAppState.isDisableAllApps()) {
return false;