Skip to content

Commit

Permalink
[BottomSheet] Updated a11y focus to move to bottom sheet when expande…
Browse files Browse the repository at this point in the history
…d and siblings are hidden from a11y services.

PiperOrigin-RevId: 320631879
  • Loading branch information
hunterstich committed Jul 10, 2020
1 parent 43fe75f commit b93042d
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@
import android.view.ViewConfiguration;
import android.view.ViewGroup;
import android.view.ViewParent;
import android.view.accessibility.AccessibilityEvent;
import androidx.annotation.FloatRange;
import androidx.annotation.IntDef;
import androidx.annotation.NonNull;
Expand Down Expand Up @@ -1677,6 +1678,10 @@ private void updateImportantForAccessibility(boolean expanded) {

if (!expanded) {
importantForAccessibilityMap = null;
} else if (updateImportantForAccessibilityOnSiblings) {
// If the siblings of the bottom sheet have been set to not important for a11y, move the focus
// to the bottom sheet when expanded.
viewRef.get().sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
}
}

Expand Down

0 comments on commit b93042d

Please sign in to comment.