Calling the correct method when adding accessibility focusables.
1. Since we added explicit accessibility focusable attribute when adding focusables views that do so should call this method. Some views were not updated to do so. bug:6581924 Change-Id: Id64c0b2d76e5269ebf3fbe17203e73b174bdb843
This commit is contained in:
@@ -6308,10 +6308,7 @@ public class View implements Drawable.Callback, Drawable.Callback2, KeyEvent.Cal
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @hide
|
||||
*/
|
||||
public boolean canTakeAccessibilityFocusFromHover() {
|
||||
private boolean canTakeAccessibilityFocusFromHover() {
|
||||
if (includeForAccessibility() && isActionableForAccessibility()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1334,12 +1334,12 @@ public abstract class AbsListView extends AdapterView<ListAdapter> implements Te
|
||||
switch(direction) {
|
||||
case ACCESSIBILITY_FOCUS_BACKWARD: {
|
||||
View focusable = (getChildCount() > 0) ? getChildAt(getChildCount() - 1) : this;
|
||||
if (focusable.canTakeAccessibilityFocusFromHover()) {
|
||||
if (focusable.isAccessibilityFocusable()) {
|
||||
views.add(focusable);
|
||||
}
|
||||
} return;
|
||||
case ACCESSIBILITY_FOCUS_FORWARD: {
|
||||
if (canTakeAccessibilityFocusFromHover()) {
|
||||
if (isAccessibilityFocusable()) {
|
||||
views.add(this);
|
||||
}
|
||||
} return;
|
||||
|
||||
@@ -1421,7 +1421,7 @@ public class NumberPicker extends LinearLayout {
|
||||
// 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 (canTakeAccessibilityFocusFromHover() || getAccessibilityNodeProvider() != null) {
|
||||
if (isAccessibilityFocusable()) {
|
||||
views.add(this);
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user