Merge "Fix a11y announcements for snoozing" into udc-dev am: 4ad574ae86

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/22257386

Change-Id: I7763d8c1d9917d17b49124074b8f6701f421b126
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Julia Reynolds
2023-03-27 16:08:27 +00:00
committed by Automerger Merge Worker
2 changed files with 6 additions and 0 deletions

View File

@@ -46,6 +46,7 @@
android:layout_toEndOf="@+id/snooze_option_default" android:layout_toEndOf="@+id/snooze_option_default"
android:layout_centerVertical="true" android:layout_centerVertical="true"
android:paddingTop="1dp" android:paddingTop="1dp"
android:importantForAccessibility="yes"
android:tint="#9E9E9E" /> android:tint="#9E9E9E" />
<TextView <TextView

View File

@@ -290,6 +290,9 @@ public class NotificationSnooze extends LinearLayout
int drawableId = show ? com.android.internal.R.drawable.ic_collapse_notification int drawableId = show ? com.android.internal.R.drawable.ic_collapse_notification
: com.android.internal.R.drawable.ic_expand_notification; : com.android.internal.R.drawable.ic_expand_notification;
mExpandButton.setImageResource(drawableId); mExpandButton.setImageResource(drawableId);
mExpandButton.setContentDescription(mContext.getString(show
? com.android.internal.R.string.expand_button_content_description_expanded
: com.android.internal.R.string.expand_button_content_description_collapsed));
if (mExpanded != show) { if (mExpanded != show) {
mExpanded = show; mExpanded = show;
animateSnoozeOptions(show); animateSnoozeOptions(show);
@@ -373,6 +376,7 @@ public class NotificationSnooze extends LinearLayout
} else if (id == R.id.notification_snooze) { } else if (id == R.id.notification_snooze) {
// Toggle snooze options // Toggle snooze options
showSnoozeOptions(!mExpanded); showSnoozeOptions(!mExpanded);
mSnoozeView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED);
mMetricsLogger.write(!mExpanded ? OPTIONS_OPEN_LOG : OPTIONS_CLOSE_LOG); mMetricsLogger.write(!mExpanded ? OPTIONS_OPEN_LOG : OPTIONS_CLOSE_LOG);
} else { } else {
// Undo snooze was selected // Undo snooze was selected
@@ -401,6 +405,7 @@ public class NotificationSnooze extends LinearLayout
public View getContentView() { public View getContentView() {
// Reset the view before use // Reset the view before use
setSelected(mDefaultOption, false); setSelected(mDefaultOption, false);
showSnoozeOptions(false);
return this; return this;
} }