diff options
author | Sunny Goyal <sunnygoyal@google.com> | 2016-08-03 20:19:41 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2016-08-03 20:19:41 +0000 |
commit | 40a29161aec5f07a089e7cc4e4c804b23ca50b57 (patch) | |
tree | 4f8c0d3b44fb2f3dad0a25a1da28e13e5abf72e7 /src | |
parent | f0cb6018dd7d91e58d2e9513f63ce7e2710c85d3 (diff) | |
parent | 7d552c8b18cfad9f32fb5028c53960a9f19dc0a8 (diff) | |
download | android_packages_apps_Trebuchet-40a29161aec5f07a089e7cc4e4c804b23ca50b57.tar.gz android_packages_apps_Trebuchet-40a29161aec5f07a089e7cc4e4c804b23ca50b57.tar.bz2 android_packages_apps_Trebuchet-40a29161aec5f07a089e7cc4e4c804b23ca50b57.zip |
Merge "Disabling accessibility focus on all children when shortcuts is open" into ub-launcher3-calgary
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/dragndrop/DragLayer.java | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/src/com/android/launcher3/dragndrop/DragLayer.java b/src/com/android/launcher3/dragndrop/DragLayer.java index 28b6f3ead..3300b7699 100644 --- a/src/com/android/launcher3/dragndrop/DragLayer.java +++ b/src/com/android/launcher3/dragndrop/DragLayer.java @@ -374,22 +374,32 @@ public class DragLayer extends InsettableFrameLayout { @Override public boolean onRequestSendAccessibilityEvent(View child, AccessibilityEvent event) { - Folder currentFolder = mLauncher.getWorkspace().getOpenFolder(); - if (currentFolder != null) { - if (child == currentFolder) { - return super.onRequestSendAccessibilityEvent(child, event); - } + // Shortcuts can appear above folder + View topView = mLauncher.getOpenShortcutsContainer(); + if (topView != null) { + return handleTopViewSendAccessibilityEvent(topView, child, event); + } - if (isInAccessibleDrag() && child instanceof DropTargetBar) { - return super.onRequestSendAccessibilityEvent(child, event); - } - // Skip propagating onRequestSendAccessibilityEvent all for other children - // when a folder is open - return false; + topView = mLauncher.getWorkspace().getOpenFolder(); + if (topView != null) { + return handleTopViewSendAccessibilityEvent(topView, child, event); } return super.onRequestSendAccessibilityEvent(child, event); } + private boolean handleTopViewSendAccessibilityEvent( + View topView, View child, AccessibilityEvent event) { + if (child == topView) { + return super.onRequestSendAccessibilityEvent(child, event); + } + if (isInAccessibleDrag() && child instanceof DropTargetBar) { + return super.onRequestSendAccessibilityEvent(child, event); + } + // Skip propagating onRequestSendAccessibilityEvent for all other children + // which are not topView + return false; + } + @Override public void addChildrenForAccessibility(ArrayList<View> childrenForAccessibility) { Folder currentFolder = mLauncher.getWorkspace().getOpenFolder(); |