Transformation- Ignore the scrim when updating accessibility importance. The scrim is used to dismiss an expanded FAB, so this helps ensure that the scrim remains clickable with Switch Access and TalkBack after a FAB has been expanded.

PiperOrigin-RevId: 194445155
This commit is contained in:
Material Design Team 2018-04-26 16:29:54 -04:00 committed by Daniel Nizri
parent 12b927b12b
commit e75ec0d6fd

View File

@ -87,7 +87,13 @@ public class FabTransformationSheetBehavior extends FabTransformationBehavior {
for (int i = 0; i < childCount; i++) {
final View child = parent.getChildAt(i);
if (child == sheet) {
// Don't change the accessibility importance of the sheet or the scrim.
boolean hasScrimBehavior =
(child.getLayoutParams() instanceof CoordinatorLayout.LayoutParams)
&& (((CoordinatorLayout.LayoutParams) child.getLayoutParams()).getBehavior()
instanceof FabTransformationScrimBehavior);
if (child == sheet || hasScrimBehavior) {
continue;
}