Improved expand accessibility experience
The expand action is now on the notification itself
instead of the expand button, this way a user immediately
know if it is expanded.
It also improves the click feedback of the expand button
Test: add notifications, observe accessibility feedback
Change-Id: I9c397d839df52d5354d7ae16725ce3e595da19c7
Fixes: 32322410
Fixes: 35064589
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
index 602c3df..2d7a03b 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/ExpandableNotificationRow.java
@@ -1720,6 +1720,9 @@
@Override
public boolean isContentExpandable() {
+ if (mIsSummaryWithChildren && !mShowingPublic) {
+ return true;
+ }
NotificationContentView showingLayout = getShowingLayout();
return showingLayout.isContentExpandable();
}
@@ -1987,6 +1990,26 @@
if (canViewBeDismissed()) {
info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_DISMISS);
}
+ boolean expandable = mShowingPublic;
+ boolean isExpanded = false;
+ if (!expandable) {
+ if (mIsSummaryWithChildren) {
+ expandable = true;
+ if (!mIsLowPriority || isExpanded()) {
+ isExpanded = isGroupExpanded();
+ }
+ } else {
+ expandable = mPrivateLayout.isContentExpandable();
+ isExpanded = isExpanded();
+ }
+ }
+ if (expandable) {
+ if (isExpanded) {
+ info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_COLLAPSE);
+ } else {
+ info.addAction(AccessibilityNodeInfo.AccessibilityAction.ACTION_EXPAND);
+ }
+ }
}
@Override
@@ -1999,6 +2022,10 @@
NotificationStackScrollLayout.performDismiss(this, mGroupManager,
true /* fromAccessibility */);
return true;
+ case AccessibilityNodeInfo.ACTION_COLLAPSE:
+ case AccessibilityNodeInfo.ACTION_EXPAND:
+ mExpandClickListener.onClick(this);
+ return true;
}
return false;
}