summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/com/android/launcher2/Cling.java33
-rw-r--r--src/com/android/launcher2/Launcher.java1
2 files changed, 34 insertions, 0 deletions
diff --git a/src/com/android/launcher2/Cling.java b/src/com/android/launcher2/Cling.java
index d61b988..5cde0b4 100644
--- a/src/com/android/launcher2/Cling.java
+++ b/src/com/android/launcher2/Cling.java
@@ -28,6 +28,10 @@ import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.util.AttributeSet;
import android.util.DisplayMetrics;
+import android.view.FocusFinder;
+import android.view.MotionEvent;
+import android.view.View;
+import android.view.accessibility.AccessibilityManager;
import android.widget.FrameLayout;
import com.android.launcher.R;
@@ -130,6 +134,35 @@ public class Cling extends FrameLayout {
}
@Override
+ public View findViewToTakeAccessibilityFocusFromHover(View child, View descendant) {
+ if (descendant.includeForAccessibility()) {
+ return descendant;
+ }
+ return null;
+ }
+
+ @Override
+ public View focusSearch(int direction) {
+ return this.focusSearch(null, direction);
+ }
+
+ @Override
+ public View focusSearch(View focused, int direction) {
+ return FocusFinder.getInstance().findNextFocus(this, focused, direction);
+ }
+
+ @Override
+ public boolean onHoverEvent(MotionEvent event) {
+ return (mDrawIdentifier.equals(WORKSPACE_PORTRAIT)
+ || mDrawIdentifier.equals(WORKSPACE_LANDSCAPE)
+ || mDrawIdentifier.equals(WORKSPACE_LARGE)
+ || mDrawIdentifier.equals(ALLAPPS_PORTRAIT)
+ || mDrawIdentifier.equals(ALLAPPS_LANDSCAPE)
+ || mDrawIdentifier.equals(ALLAPPS_LARGE)
+ || mDrawIdentifier.equals(WORKSPACE_CUSTOM));
+ }
+
+ @Override
public boolean onTouchEvent(android.view.MotionEvent event) {
if (mDrawIdentifier.equals(WORKSPACE_PORTRAIT) ||
mDrawIdentifier.equals(WORKSPACE_LANDSCAPE) ||
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index f5624e0..84b5003 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -3467,6 +3467,7 @@ public final class Launcher extends Activity
cling.init(this, positionData);
cling.setVisibility(View.VISIBLE);
cling.setLayerType(View.LAYER_TYPE_HARDWARE, null);
+ cling.requestAccessibilityFocus();
if (animate) {
cling.buildLayer();
cling.setAlpha(0f);