Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1348,7 +1348,7 @@ public class BubbleController { mStackView.updateContentDescription(); mStackView.updateContentDescription(); mStackView.updateBubblesClickableStates(); mStackView.updateBubblesAcessibillityStates(); } } @VisibleForTesting @VisibleForTesting Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +55 −11 Original line number Original line Diff line number Diff line Loading @@ -1486,19 +1486,63 @@ public class BubbleStackView extends FrameLayout } } /** /** * Update bubbles' icon views clickable states. * Update bubbles' icon views accessibility states. */ */ public void updateBubblesClickableStates() { public void updateBubblesAcessibillityStates() { for (int i = 0; i < mBubbleData.getBubbles().size(); i++) { for (int i = 0; i < mBubbleData.getBubbles().size(); i++) { final Bubble bubble = mBubbleData.getBubbles().get(i); Bubble prevBubble = i > 0 ? mBubbleData.getBubbles().get(i - 1) : null; if (bubble.getIconView() != null) { Bubble bubble = mBubbleData.getBubbles().get(i); View bubbleIconView = bubble.getIconView(); if (bubbleIconView == null) { continue; } if (mIsExpanded) { if (mIsExpanded) { // when stack is expanded all bubbles are clickable // when stack is expanded bubble.getIconView().setClickable(true); // all bubbles are important for accessibility bubbleIconView .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); View prevBubbleIconView = prevBubble != null ? prevBubble.getIconView() : null; if (prevBubbleIconView != null) { bubbleIconView.setAccessibilityDelegate(new View.AccessibilityDelegate() { @Override public void onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(v, info); info.setTraversalAfter(prevBubbleIconView); } }); } } else { } else { // when stack is collapsed, only the top bubble needs to be clickable, // when stack is collapsed, only the top bubble is important for accessibility, // so that a11y ignores all the inaccessible bubbles in the stack bubbleIconView.setImportantForAccessibility( bubble.getIconView().setClickable(i == 0); i == 0 ? View.IMPORTANT_FOR_ACCESSIBILITY_YES : View.IMPORTANT_FOR_ACCESSIBILITY_NO); } } if (mIsExpanded) { // make the overflow bubble last in the accessibility traversal order View bubbleOverflowIconView = mBubbleOverflow != null ? mBubbleOverflow.getIconView() : null; if (bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { Bubble lastBubble = mBubbleData.getBubbles().get(mBubbleData.getBubbles().size() - 1); View lastBubbleIconView = lastBubble.getIconView(); if (lastBubbleIconView != null) { bubbleOverflowIconView.setAccessibilityDelegate( new View.AccessibilityDelegate() { @Override public void onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(v, info); info.setTraversalAfter(lastBubbleIconView); } }); } } } } } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -1348,7 +1348,7 @@ public class BubbleController { mStackView.updateContentDescription(); mStackView.updateContentDescription(); mStackView.updateBubblesClickableStates(); mStackView.updateBubblesAcessibillityStates(); } } @VisibleForTesting @VisibleForTesting Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +55 −11 Original line number Original line Diff line number Diff line Loading @@ -1486,19 +1486,63 @@ public class BubbleStackView extends FrameLayout } } /** /** * Update bubbles' icon views clickable states. * Update bubbles' icon views accessibility states. */ */ public void updateBubblesClickableStates() { public void updateBubblesAcessibillityStates() { for (int i = 0; i < mBubbleData.getBubbles().size(); i++) { for (int i = 0; i < mBubbleData.getBubbles().size(); i++) { final Bubble bubble = mBubbleData.getBubbles().get(i); Bubble prevBubble = i > 0 ? mBubbleData.getBubbles().get(i - 1) : null; if (bubble.getIconView() != null) { Bubble bubble = mBubbleData.getBubbles().get(i); View bubbleIconView = bubble.getIconView(); if (bubbleIconView == null) { continue; } if (mIsExpanded) { if (mIsExpanded) { // when stack is expanded all bubbles are clickable // when stack is expanded bubble.getIconView().setClickable(true); // all bubbles are important for accessibility bubbleIconView .setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES); View prevBubbleIconView = prevBubble != null ? prevBubble.getIconView() : null; if (prevBubbleIconView != null) { bubbleIconView.setAccessibilityDelegate(new View.AccessibilityDelegate() { @Override public void onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(v, info); info.setTraversalAfter(prevBubbleIconView); } }); } } else { } else { // when stack is collapsed, only the top bubble needs to be clickable, // when stack is collapsed, only the top bubble is important for accessibility, // so that a11y ignores all the inaccessible bubbles in the stack bubbleIconView.setImportantForAccessibility( bubble.getIconView().setClickable(i == 0); i == 0 ? View.IMPORTANT_FOR_ACCESSIBILITY_YES : View.IMPORTANT_FOR_ACCESSIBILITY_NO); } } if (mIsExpanded) { // make the overflow bubble last in the accessibility traversal order View bubbleOverflowIconView = mBubbleOverflow != null ? mBubbleOverflow.getIconView() : null; if (bubbleOverflowIconView != null && !mBubbleData.getBubbles().isEmpty()) { Bubble lastBubble = mBubbleData.getBubbles().get(mBubbleData.getBubbles().size() - 1); View lastBubbleIconView = lastBubble.getIconView(); if (lastBubbleIconView != null) { bubbleOverflowIconView.setAccessibilityDelegate( new View.AccessibilityDelegate() { @Override public void onInitializeAccessibilityNodeInfo(View v, AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(v, info); info.setTraversalAfter(lastBubbleIconView); } }); } } } } } } Loading