summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher2/FocusHelper.java
diff options
context:
space:
mode:
authorWinson Chung <winsonc@google.com>2011-07-21 11:46:32 -0700
committerWinson Chung <winsonc@google.com>2011-07-21 11:48:43 -0700
commit4d279d94ade1c0d455404312b3c9cfde0078c547 (patch)
treeaa7bf49d38894173563d98df254475ca7a104969 /src/com/android/launcher2/FocusHelper.java
parentf55cd6a46c25cab8b3a9e90ba3cff4ca237149df (diff)
downloadandroid_packages_apps_Trebuchet-4d279d94ade1c0d455404312b3c9cfde0078c547.tar.gz
android_packages_apps_Trebuchet-4d279d94ade1c0d455404312b3c9cfde0078c547.tar.bz2
android_packages_apps_Trebuchet-4d279d94ade1c0d455404312b3c9cfde0078c547.zip
Fixing various issues with the dock.
- Prevent crash due to no overlays in certain device configurations - Fixing kb crash and adding content description for Apps button Change-Id: Ie2a2bc29e7b9408a165f93d108fdd803193afc29
Diffstat (limited to 'src/com/android/launcher2/FocusHelper.java')
-rw-r--r--src/com/android/launcher2/FocusHelper.java17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/com/android/launcher2/FocusHelper.java b/src/com/android/launcher2/FocusHelper.java
index 233fd6fbb..3783d566c 100644
--- a/src/com/android/launcher2/FocusHelper.java
+++ b/src/com/android/launcher2/FocusHelper.java
@@ -31,9 +31,19 @@ import java.util.Collections;
import java.util.Comparator;
/**
+ * A keyboard listener we set on all the workspace icons.
+ */
+class BubbleTextViewKeyEventListener implements View.OnKeyListener {
+ @Override
+ public boolean onKey(View v, int keyCode, KeyEvent event) {
+ return FocusHelper.handleBubbleTextViewKeyEvent((BubbleTextView) v, keyCode, event);
+ }
+}
+
+/**
* A keyboard listener we set on all the hotseat buttons.
*/
-class HotseatKeyEventListener implements View.OnKeyListener {
+class HotseatBubbleTextViewKeyEventListener implements View.OnKeyListener {
@Override
public boolean onKey(View v, int keyCode, KeyEvent event) {
final Configuration configuration = v.getResources().getConfiguration();
@@ -612,6 +622,7 @@ public class FocusHelper {
final Workspace workspace = (Workspace) layout.getParent();
final ViewGroup launcher = (ViewGroup) workspace.getParent();
final ViewGroup tabs = (ViewGroup) launcher.findViewById(R.id.qsb_bar);
+ final ViewGroup hotseat = (ViewGroup) launcher.findViewById(R.id.hotseat);
int iconIndex = parent.indexOfChild(v);
int iconCount = parent.getChildCount();
int pageIndex = workspace.indexOfChild(layout);
@@ -678,11 +689,13 @@ public class FocusHelper {
break;
case KeyEvent.KEYCODE_DPAD_DOWN:
if (handleKeyEvent) {
- // Select the closest icon in the next line, otherwise select the tab bar
+ // Select the closest icon in the next line, otherwise select the button bar
View newIcon = getClosestBubbleTextViewOnLine(layout, parent, v, 1);
if (newIcon != null) {
newIcon.requestFocus();
wasHandled = true;
+ } else if (hotseat != null) {
+ hotseat.requestFocus();
}
}
break;