diff options
| author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-07-02 18:12:00 -0700 |
|---|---|---|
| committer | Svetoslav Ganov <svetoslavganov@google.com> | 2012-07-02 18:21:31 -0700 |
| commit | 27e2da7c171afa39358bbead18fbe3e6b8ea6637 (patch) | |
| tree | a506f123a83de24081650f819db65b2b5e3f92cb /core/java/android/widget/NumberPicker.java | |
| parent | 0a6101b2adaae2128e4cad8247f827c164b8d657 (diff) | |
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
Diffstat (limited to 'core/java/android/widget/NumberPicker.java')
| -rw-r--r-- | core/java/android/widget/NumberPicker.java | 85 |
1 files changed, 0 insertions, 85 deletions
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 @@ -1417,19 +1417,6 @@ public class NumberPicker extends LinearLayout { } @Override - public void addFocusables(ArrayList<View> 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); event.setClassName(NumberPicker.class.getName()); @@ -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: { |
