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

Bug: 29581071
Change-Id: I1a876b4e8530601cb9bf25d097ea37780b525610
This commit is contained in:
Sunny Goyal
2016-06-22 16:29:24 -07:00
parent 8a4bb33472
commit d8d19938e4
+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);
}
}
}