Merge "Allows Accessibility to focus on specified view in AbstractFloatingView." into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
479ff47a72
@@ -174,7 +174,8 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
targetInfo.first, TYPE_WINDOW_STATE_CHANGED, targetInfo.second);
|
||||
|
||||
if (mIsOpen) {
|
||||
performAccessibilityAction(AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
|
||||
getAccessibilityInitialFocusView().performAccessibilityAction(
|
||||
AccessibilityNodeInfo.ACTION_ACCESSIBILITY_FOCUS, null);
|
||||
}
|
||||
ActivityContext.lookupContext(getContext()).getDragLayer()
|
||||
.sendAccessibilityEvent(TYPE_WINDOW_CONTENT_CHANGED);
|
||||
@@ -184,6 +185,11 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
return null;
|
||||
}
|
||||
|
||||
/** Returns the View that Accessibility services should focus on first. */
|
||||
protected View getAccessibilityInitialFocusView() {
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns a view matching FloatingViewType
|
||||
*/
|
||||
|
||||
@@ -745,6 +745,11 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo
|
||||
: getContext().getString(R.string.folder_closed));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View getAccessibilityInitialFocusView() {
|
||||
return mContent.getFirstItem();
|
||||
}
|
||||
|
||||
private void closeComplete(boolean wasAnimated) {
|
||||
// TODO: Clear all active animations.
|
||||
DragLayer parent = (DragLayer) getParent();
|
||||
|
||||
@@ -389,6 +389,11 @@ public abstract class ArrowPopup<T extends BaseDraggingActivity> extends Abstrac
|
||||
return Pair.create(this, "");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected View getAccessibilityInitialFocusView() {
|
||||
return getChildCount() > 0 ? getChildAt(0) : this;
|
||||
}
|
||||
|
||||
private void animateOpen() {
|
||||
setVisibility(View.VISIBLE);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user