Fix bottom action bar accessibility issues
- Switch Access should not select bottom action bar frame, it should be
able to select bottom action buttons only.
- Talkback should not be able to select pill buttons when button sheet is expanding.
Bug: 190153734
Test: Manually
Change-Id: I1d51ce6c5223d9ecb6d2d273ea1386f43d443c0e
diff --git a/res/layout/bottom_actions_layout.xml b/res/layout/bottom_actions_layout.xml
index 92b5dc1..2d317a9 100644
--- a/res/layout/bottom_actions_layout.xml
+++ b/res/layout/bottom_actions_layout.xml
@@ -45,7 +45,6 @@
android:layout_height="@dimen/bottom_actions_height"
android:paddingTop="@dimen/bottom_actions_top_padding"
android:paddingBottom="@dimen/bottom_actions_bottom_padding"
- android:clickable="true"
android:background="?android:colorBackground"
android:theme="@style/BottomActionItemStyle"
android:layout_alignParentBottom="true"
diff --git a/src/com/android/wallpaper/picker/ImagePreviewFragment.java b/src/com/android/wallpaper/picker/ImagePreviewFragment.java
index d4c8ef5..8ce50f9 100755
--- a/src/com/android/wallpaper/picker/ImagePreviewFragment.java
+++ b/src/com/android/wallpaper/picker/ImagePreviewFragment.java
@@ -15,6 +15,8 @@
*/
package com.android.wallpaper.picker;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
import static android.view.View.MeasureSpec.EXACTLY;
import static android.view.View.MeasureSpec.makeMeasureSpec;
@@ -252,18 +254,23 @@
mBottomActionBar.setActionClickListener(APPLY, this::onSetWallpaperClicked);
+ View pillTabsContainer = getView().findViewById(R.id.pill_tabs_container);
// Update target view's accessibility param since it will be blocked by the bottom sheet
// when expanded.
mBottomActionBar.setAccessibilityCallback(new AccessibilityCallback() {
@Override
public void onBottomSheetCollapsed() {
- mContainer.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ mContainer.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ pillTabsContainer.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
}
@Override
public void onBottomSheetExpanded() {
mContainer.setImportantForAccessibility(
- View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
+ IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
+ pillTabsContainer.setImportantForAccessibility(
+ IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
+
}
});
diff --git a/src/com/android/wallpaper/picker/LivePreviewFragment.java b/src/com/android/wallpaper/picker/LivePreviewFragment.java
index b92170e..07f85b6 100644
--- a/src/com/android/wallpaper/picker/LivePreviewFragment.java
+++ b/src/com/android/wallpaper/picker/LivePreviewFragment.java
@@ -15,6 +15,9 @@
*/
package com.android.wallpaper.picker;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS;
+import static android.view.View.IMPORTANT_FOR_ACCESSIBILITY_YES;
+
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.APPLY;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.CUSTOMIZE;
import static com.android.wallpaper.widget.BottomActionBar.BottomAction.DELETE;
@@ -387,19 +390,22 @@
mBottomActionBar.setActionClickListener(APPLY, unused -> onSetWallpaperClicked(null));
mBottomActionBar.attachViewToBottomSheetAndBindAction(mWallpaperInfoView, INFORMATION);
+ View pillTabsContainer = getView().findViewById(R.id.pill_tabs_container);
// Update target view's accessibility param since it will be blocked by the bottom sheet
// when expanded.
mBottomActionBar.setAccessibilityCallback(new AccessibilityCallback() {
@Override
public void onBottomSheetCollapsed() {
- mPreviewContainer.setImportantForAccessibility(
- View.IMPORTANT_FOR_ACCESSIBILITY_YES);
+ mPreviewContainer.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
+ pillTabsContainer.setImportantForAccessibility(IMPORTANT_FOR_ACCESSIBILITY_YES);
}
@Override
public void onBottomSheetExpanded() {
mPreviewContainer.setImportantForAccessibility(
- View.IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
+ IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
+ pillTabsContainer.setImportantForAccessibility(
+ IMPORTANT_FOR_ACCESSIBILITY_NO_HIDE_DESCENDANTS);
}
});
final Uri uriSettingsSlice = getSettingsSliceUri(mWallpaper.getWallpaperComponent());