summaryrefslogtreecommitdiffstats
path: root/src/com
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-05-22 17:36:43 -0700
committerAndroid (Google) Code Review <android-gerrit@google.com>2012-05-22 17:36:43 -0700
commitb6d33ebc41b13cb51d4bc142cbfbf4970aba9426 (patch)
tree97f9dfdafce378c68164c316141b367a8d6e7058 /src/com
parentf9c3679dc1492b8d97c6cc0aa15f3dfda7439bf3 (diff)
parent55d225d50e68b3ea629c45a53d6744b52e335134 (diff)
downloadpackages_apps_trebuchet-b6d33ebc41b13cb51d4bc142cbfbf4970aba9426.zip
packages_apps_trebuchet-b6d33ebc41b13cb51d4bc142cbfbf4970aba9426.tar.gz
packages_apps_trebuchet-b6d33ebc41b13cb51d4bc142cbfbf4970aba9426.tar.bz2
Merge "Cling allows touch explore and accessibility focus search behind it." into jb-dev
Diffstat (limited to 'src/com')
-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);