From 27e2da7c171afa39358bbead18fbe3e6b8ea6637 Mon Sep 17 00:00:00 2001 From: Svetoslav Ganov Date: Mon, 2 Jul 2012 18:12:00 -0700 Subject: Remove the accessibility focus search code. 1. In JellyBean we have added some APIs to search for next accessibility focus in various directions and set accessibility focus from hover. However, we have decided that there is not clean answer for how this should behave and the APIs were hidden. Now the accessibility service is responsible for that. The unused code is now taken out. 2. This patch also takes out the hidden attribute accessibiligyFocusable since we moved the responsibility for implementing focus search strategy to accessibility services and we did not need that for Jellybean which is a good sign that this is not needed. I general this is one less thing for an app developer to worry about. We can add this if needed later. bug:6773816 Change-Id: I0c858d72c93a2b7ff1f8f35a08d33ec4b9eb85fd --- core/java/android/widget/NumberPicker.java | 85 ------------------------------ 1 file changed, 85 deletions(-) (limited to 'core/java/android/widget/NumberPicker.java') diff --git a/core/java/android/widget/NumberPicker.java b/core/java/android/widget/NumberPicker.java index a458f57d7de2..02bcf1e4c069 100644 --- a/core/java/android/widget/NumberPicker.java +++ b/core/java/android/widget/NumberPicker.java @@ -1416,19 +1416,6 @@ public class NumberPicker extends LinearLayout { } } - @Override - public void addFocusables(ArrayList views, int direction, int focusableMode) { - // We do not want the real descendant to be considered focus search - // since it is managed by the accessibility node provider. - if ((focusableMode & FOCUSABLES_ACCESSIBILITY) == FOCUSABLES_ACCESSIBILITY) { - if (isAccessibilityFocusable()) { - views.add(this); - return; - } - } - super.addFocusables(views, direction, focusableMode); - } - @Override public void onInitializeAccessibilityEvent(AccessibilityEvent event) { super.onInitializeAccessibilityEvent(event); @@ -2297,78 +2284,6 @@ public class NumberPicker extends LinearLayout { return super.performAction(virtualViewId, action, arguments); } - @Override - public AccessibilityNodeInfo findAccessibilityFocus(int virtualViewId) { - return createAccessibilityNodeInfo(mAccessibilityFocusedView); - } - - @Override - public AccessibilityNodeInfo accessibilityFocusSearch(int direction, int virtualViewId) { - switch (direction) { - case View.ACCESSIBILITY_FOCUS_DOWN: - case View.ACCESSIBILITY_FOCUS_FORWARD: { - switch (mAccessibilityFocusedView) { - case UNDEFINED: { - return createAccessibilityNodeInfo(View.NO_ID); - } - case View.NO_ID: { - if (hasVirtualDecrementButton()) { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_DECREMENT); - } - } - //$FALL-THROUGH$ - case VIRTUAL_VIEW_ID_DECREMENT: { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INPUT); - } - case VIRTUAL_VIEW_ID_INPUT: { - if (hasVirtualIncrementButton()) { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INCREMENT); - } - } - //$FALL-THROUGH$ - case VIRTUAL_VIEW_ID_INCREMENT: { - View nextFocus = NumberPicker.this.focusSearch(direction); - if (nextFocus != null) { - return nextFocus.createAccessibilityNodeInfo(); - } - return null; - } - } - } break; - case View.ACCESSIBILITY_FOCUS_UP: - case View.ACCESSIBILITY_FOCUS_BACKWARD: { - switch (mAccessibilityFocusedView) { - case UNDEFINED: { - return createAccessibilityNodeInfo(View.NO_ID); - } - case View.NO_ID: { - if (hasVirtualIncrementButton()) { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INCREMENT); - } - } - //$FALL-THROUGH$ - case VIRTUAL_VIEW_ID_INCREMENT: { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_INPUT); - } - case VIRTUAL_VIEW_ID_INPUT: { - if (hasVirtualDecrementButton()) { - return createAccessibilityNodeInfo(VIRTUAL_VIEW_ID_DECREMENT); - } - } - //$FALL-THROUGH$ - case VIRTUAL_VIEW_ID_DECREMENT: { - View nextFocus = NumberPicker.this.focusSearch(direction); - if (nextFocus != null) { - return nextFocus.createAccessibilityNodeInfo(); - } - return null; - } - } - } break; - } - return null; - } - public void sendAccessibilityEventForVirtualView(int virtualViewId, int eventType) { switch (virtualViewId) { case VIRTUAL_VIEW_ID_DECREMENT: { -- cgit v1.2.3