summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-05-22 17:39:19 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-05-22 17:39:19 -0700
commitd4026ac5a57463b9533c6aa4c6bdd63be44200eb (patch)
tree97f9dfdafce378c68164c316141b367a8d6e7058
parent4dd738192b9da9313840fd82962d933c36d5b84b (diff)
parentb6d33ebc41b13cb51d4bc142cbfbf4970aba9426 (diff)
downloadandroid_packages_apps_Trebuchet-d4026ac5a57463b9533c6aa4c6bdd63be44200eb.zip
android_packages_apps_Trebuchet-d4026ac5a57463b9533c6aa4c6bdd63be44200eb.tar.gz
android_packages_apps_Trebuchet-d4026ac5a57463b9533c6aa4c6bdd63be44200eb.tar.bz2
am b6d33ebc: Merge "Cling allows touch explore and accessibility focus search behind it." into jb-dev
* commit 'b6d33ebc41b13cb51d4bc142cbfbf4970aba9426': Cling allows touch explore and accessibility focus search behind it.
-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);