Add Talkback navigation for BABar bottom sheet
Video: https://drive.google.com/file/d/1Cahc2oh-RjL1MNSY6eWBh5hoDnp1jigR/view?usp=sharing
Test: Manually
Bug: 156985852
Change-Id: I562129021186cbe19a048e6c549c8796d2f59bce
diff --git a/res/layout/bottom_actions_layout.xml b/res/layout/bottom_actions_layout.xml
index 41c2e6f..38bd574 100644
--- a/res/layout/bottom_actions_layout.xml
+++ b/res/layout/bottom_actions_layout.xml
@@ -31,6 +31,7 @@
android:layout_height="wrap_content"
android:background="@drawable/bottom_sheet_background"
android:theme="@style/WallpaperPicker.BottomPaneStyle"
+ android:clickable="true"
android:elevation="@dimen/bottom_action_bar_elevation"
android:layout_marginTop="@dimen/bottom_action_bar_bottom_sheet_margin_top"
app:behavior_peekHeight="@dimen/preview_attribution_pane_collapsed_height"
diff --git a/src/com/android/wallpaper/widget/BottomActionBar.java b/src/com/android/wallpaper/widget/BottomActionBar.java
index 0859a0a..cd779a9 100644
--- a/src/com/android/wallpaper/widget/BottomActionBar.java
+++ b/src/com/android/wallpaper/widget/BottomActionBar.java
@@ -169,11 +169,13 @@
*/
public void attachViewToBottomSheetAndBindAction(View contentView, BottomAction action) {
contentView.setVisibility(GONE);
+ contentView.setFocusable(true);
mContentViewMap.put(action, contentView);
mBottomSheetView.addView(contentView);
- setActionClickListener(action, unused -> {
+ setActionClickListener(action, actionView -> {
mCurrentBottomSheetAction = action;
mContentViewMap.forEach((a, v) -> v.setVisibility(a.equals(action) ? VISIBLE : GONE));
+ mBottomSheetView.setAccessibilityTraversalAfter(actionView.getId());
});
}