From fd68f757c8525d6e589e387ed9b46d69c00b6e95 Mon Sep 17 00:00:00 2001 From: Steven Ng Date: Mon, 26 Apr 2021 21:58:30 +0100 Subject: [PATCH] Add a11y action for expand / collapse items in WidgetsFullSheet Test: Enable talkback. When focusing on a collapsed item, it announces Collapsed "App Name" "n widgets/shortcuts". Action available. Use tap with 3 fingers to view. 3 fingers tap > Action > Expand. Widgets are expanded. When focusing on an expanded item, it announces Expanded "App Name" "n widgets/shortcuts". Action available. Use tap with 3 fingers to view. 3 fingers tap > Action > Collapse. Widgets are collapsed. Bug: 183120145 Change-Id: Ibbb6025b929c141aa9e2fd2c72dce314e8be837e --- res/layout/widgets_list_row_header.xml | 1 + .../widget/picker/WidgetsListHeader.java | 33 ++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/res/layout/widgets_list_row_header.xml b/res/layout/widgets_list_row_header.xml index 8259c16612..cec32eabb0 100644 --- a/res/layout/widgets_list_row_header.xml +++ b/res/layout/widgets_list_row_header.xml @@ -35,6 +35,7 @@ tools:src="@drawable/ic_corp"/> { setExpanded(!mIsExpanded); - onExpandChangeListener.onExpansionChange(mIsExpanded); + if (onExpandChangeListener != null) { + onExpandChangeListener.onExpansionChange(mIsExpanded); + } }); }