Bug 1390356: Do not focus BottomSheetDialog in Talkback. r=sebastian
MozReview-Commit-ID: 5ZlKzq46tXC
--- a/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java
+++ b/mobile/android/base/java/org/mozilla/gecko/activitystream/homepanel/menu/BottomSheetContextMenu.java
@@ -141,16 +141,25 @@ import java.net.URISyntaxException;
// https://android.googlesource.com/platform/frameworks/support/+/461d9c4b4b51cd552fc890d7feb001c6bd2097ea/design/res/layout/design_bottom_sheet_dialog.xml
// I opted not to update to save time (we have an AS deadline) and to prevent possible regressions.
final View tapToDismissView = window.findViewById(android.support.design.R.id.touch_outside);
if (tapToDismissView != null) {
tapToDismissView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
} else {
isSuccess = false;
}
+
+ // We don't want to directly focus the dialog: just the list items.
+ // It's unclear if this is also fixed in the newer source code.
+ final View dialogView = window.findViewById(android.support.design.R.id.design_bottom_sheet);
+ if (dialogView != null) {
+ dialogView.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO);
+ } else {
+ isSuccess = false;
+ }
}
if (!isSuccess) {
Log.w(LOGTAG, "Unable to fully override Activity Stream bottom sheet accessibility behavior.");
}
}
public void dismiss() {