summaryrefslogtreecommitdiff
path: root/core/java/android/widget/AdapterView.java
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2012-05-08 15:58:32 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2012-05-14 16:21:29 -0700
commite5dfa47d84668376b84074c04570fb961870adeb (patch)
tree3be9fe55e6170d33bbfb7fe57af3a1cc05c05266 /core/java/android/widget/AdapterView.java
parent0d607fbe546ac943de38dad33ae681b09efec6ea (diff)
Improving accessibility focus traversal.
1. Now the views considered during the accessibility focus search are the ones that would get accessibility focus when thovered over. This way the user will get the same items i.e. feedback if he touch explores the screen and uses focus traversal. This is imperative for a good user experience. 2. Updated which focusables are considered when searching for access focus in ViewGroup. Generally accessibility focus ignores focus before/after descendants. 3. Implemented focus search strategy in AbsListView that will traverse the items of the current list (and the stuff withing one item before moving to the next) before continuing the search if forward and backward accessibility focus direction. 4. View focus search stops at root namespace. This is not the right way to prevent some stuff that is not supposed to get a focus in a container for a specific state. Actually the addFocusables for that container has to be overriden. Further this approach leads to focus getting stuck. The accessibility focus ignores root names space since we want to traverse the entire screen. 5. Fixed an bug in AccessibilityInteractionController which was not starting to search from the root of a virtual node tree. 6. Fixed a couple of bugs in FocusFinder where it was possible to get index out of bounds exception if the focusables list is empty. bug:5932640 Change-Id: Ic3bdd11767a7d40fbb21f35dcd79a4746af784d4
Diffstat (limited to 'core/java/android/widget/AdapterView.java')
-rw-r--r--core/java/android/widget/AdapterView.java20
1 files changed, 1 insertions, 19 deletions
diff --git a/core/java/android/widget/AdapterView.java b/core/java/android/widget/AdapterView.java
index abfc57763d0f..502de314051b 100644
--- a/core/java/android/widget/AdapterView.java
+++ b/core/java/android/widget/AdapterView.java
@@ -24,7 +24,6 @@ import android.util.AttributeSet;
import android.util.SparseArray;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
-import android.view.MotionEvent;
import android.view.SoundEffectConstants;
import android.view.View;
import android.view.ViewDebug;
@@ -32,6 +31,7 @@ import android.view.ViewGroup;
import android.view.accessibility.AccessibilityEvent;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.AccessibilityNodeInfo;
+import android.view.accessibility.AccessibilityNodeProvider;
/**
* An AdapterView is a view whose children are determined by an {@link Adapter}.
@@ -957,24 +957,6 @@ public abstract class AdapterView<T extends Adapter> extends ViewGroup {
event.setItemCount(getCount());
}
- /**
- * @hide
- */
- @Override
- public boolean onRequestAccessibilityFocusFromHover(float x, float y) {
- // We prefer to five focus to the child instead of this view.
- // Usually the children are not actionable for accessibility,
- // and they will not take accessibility focus, so we give it.
- final int childCount = getChildCount();
- for (int i = 0; i < childCount; i++) {
- View child = getChildAt(i);
- if (isTransformedTouchPointInView(x, y, child, null)) {
- return child.requestAccessibilityFocus();
- }
- }
- return super.onRequestAccessibilityFocusFromHover(x, y);
- }
-
private boolean isScrollableForAccessibility() {
T adapter = getAdapter();
if (adapter != null) {