Merge "Fixing accessibility drag and drop Since the page's accessibility flag is updated when entering drag mode, it does not need to be updated on state change" into ub-launcher3-calgary

This commit is contained in:
Sunny Goyal
2016-07-07 07:34:38 +00:00
committed by Android (Google) Code Review
+15 -12
View File
@@ -2088,19 +2088,22 @@ public class Workspace extends PagedView
}
public void updateAccessibilityFlags() {
if (Utilities.ATLEAST_LOLLIPOP) {
int total = getPageCount();
for (int i = numCustomPages(); i < total; i++) {
updateAccessibilityFlags((CellLayout) getPageAt(i), i);
}
setImportantForAccessibility((mState == State.NORMAL || mState == State.OVERVIEW)
? IMPORTANT_FOR_ACCESSIBILITY_AUTO
: IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
} else {
int accessible = mState == State.NORMAL ?
IMPORTANT_FOR_ACCESSIBILITY_AUTO :
// TODO: Update the accessibility flags appropriately when dragging.
if (!mLauncher.getAccessibilityDelegate().isInAccessibleDrag()) {
if (Utilities.ATLEAST_LOLLIPOP) {
int total = getPageCount();
for (int i = numCustomPages(); i < total; i++) {
updateAccessibilityFlags((CellLayout) getPageAt(i), i);
}
setImportantForAccessibility((mState == State.NORMAL || mState == State.OVERVIEW)
? IMPORTANT_FOR_ACCESSIBILITY_AUTO
: IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
} else {
int accessible = mState == State.NORMAL ?
IMPORTANT_FOR_ACCESSIBILITY_AUTO :
IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
setImportantForAccessibility(accessible);
setImportantForAccessibility(accessible);
}
}
}