diff --git a/packages/SystemUI/res/layout/notification_snooze.xml b/packages/SystemUI/res/layout/notification_snooze.xml index c350ed22b765c..253bc328c5b81 100644 --- a/packages/SystemUI/res/layout/notification_snooze.xml +++ b/packages/SystemUI/res/layout/notification_snooze.xml @@ -20,7 +20,6 @@ android:layout_width="match_parent" android:layout_height="wrap_content" android:orientation="vertical" - android:clickable="true" android:background="@color/notification_material_background_color" android:theme="@style/Theme.SystemUI"> @@ -55,6 +54,8 @@ android:layout_marginEnd="@dimen/notification_guts_button_side_margin" android:layout_alignParentEnd="true" android:layout_centerVertical="true" + android:minWidth="@dimen/min_clickable_item_size" + android:minHeight="@dimen/min_clickable_item_size" android:text="@string/snooze_undo" style="@style/TextAppearance.NotificationInfo.Button" /> diff --git a/packages/SystemUI/res/values/dimens.xml b/packages/SystemUI/res/values/dimens.xml index 2a4d5ef921f7a..e7ef8ccf4ebaa 100644 --- a/packages/SystemUI/res/values/dimens.xml +++ b/packages/SystemUI/res/values/dimens.xml @@ -16,6 +16,9 @@ */ --> + + 48dp + -12dp diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java index 5c578dfc57441..998230f205ab0 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java @@ -3001,9 +3001,7 @@ public class ExpandableNotificationRow extends ActivatableNotificationView default: if (action == R.id.action_snooze) { NotificationMenuRowPlugin provider = getProvider(); - if (provider == null && mMenuRow != null) { - provider = createMenu(); - } else { + if (provider == null) { return false; } MenuItem snoozeMenu = provider.getSnoozeMenuItem(getContext()); diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java index d65f2c53598c3..e56771c62bb5d 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/NotificationSnooze.java @@ -79,6 +79,7 @@ public class NotificationSnooze extends LinearLayout private NotificationSwipeActionHelper mSnoozeListener; private StatusBarNotification mSbn; + private View mSnoozeView; private TextView mSelectedOptionText; private TextView mUndoButton; private ImageView mExpandButton; @@ -122,7 +123,8 @@ public class NotificationSnooze extends LinearLayout protected void onFinishInflate() { super.onFinishInflate(); mCollapsedHeight = getResources().getDimensionPixelSize(R.dimen.snooze_snackbar_min_height); - findViewById(R.id.notification_snooze).setOnClickListener(this); + mSnoozeView = findViewById(R.id.notification_snooze); + mSnoozeView.setOnClickListener(this); mSelectedOptionText = (TextView) findViewById(R.id.snooze_option_default); mUndoButton = (TextView) findViewById(R.id.undo); mUndoButton.setOnClickListener(this); @@ -146,16 +148,6 @@ public class NotificationSnooze extends LinearLayout logOptionSelection(MetricsEvent.NOTIFICATION_SNOOZE_CLICKED, mDefaultOption); } - @Override - public void onInitializeAccessibilityEvent(AccessibilityEvent event) { - super.onInitializeAccessibilityEvent(event); - if (mGutsContainer != null && mGutsContainer.isExposed()) { - if (event.getEventType() == AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED) { - event.getText().add(mSelectedOptionText.getText()); - } - } - } - @Override public void onInitializeAccessibilityNodeInfo(AccessibilityNodeInfo info) { super.onInitializeAccessibilityNodeInfo(info); @@ -341,12 +333,22 @@ public class NotificationSnooze extends LinearLayout mSelectedOptionText.setText(option.getConfirmation()); showSnoozeOptions(false); hideSelectedOption(); - sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); if (userAction) { + mSnoozeView.sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_FOCUSED); logOptionSelection(MetricsEvent.NOTIFICATION_SELECT_SNOOZE, option); } } + @Override + public boolean requestAccessibilityFocus() { + if (mExpanded) { + return super.requestAccessibilityFocus(); + } else { + mSnoozeView.requestAccessibilityFocus(); + return false; + } + } + private void logOptionSelection(int category, SnoozeOption option) { int index = mSnoozeOptions.indexOf(option); long duration = TimeUnit.MINUTES.toMillis(option.getMinutesToSnoozeFor());