summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Julia Reynolds <juliacr@google.com> 2020-05-05 11:00:48 -0400
committer Julia Reynolds <juliacr@google.com> 2020-05-05 16:43:30 +0000
commit684c8817f43c873d92b480118c502c4abb34b546 (patch)
treeb6f4eadecee362eb13ab0fc57b2a359ac95363cc
parenta131a0c64f6196e039044aa3afcd6a458b1db89e (diff)
Change longpress behavior for summaries
Rather than showing notification guts, expand or collapse the summary. Test: long pressing on notifications, expanded summaries, collapsed summaries, notifications in groups Fixes: 155498734 Change-Id: I68438ff6e02e213386a257b8ca0d74552ed118ed
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRow.java5
-rw-r--r--packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java8
2 files changed, 12 insertions, 1 deletions
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 2e5af9a7414a..f7ad50edb2f6 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
@@ -2366,6 +2366,11 @@ public class ExpandableNotificationRow extends ActivatableNotificationView
updateChildrenVisibility();
applyChildrenRoundness();
}
+
+ protected void expandNotification() {
+ mExpandClickListener.onClick(this);
+ }
+
/**
* Returns the number of channels covered by the notification row (including its children if
* it's a summary notification).
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
index f8d9c4648ac9..7a6109d2ce78 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/notification/row/ExpandableNotificationRowController.java
@@ -130,7 +130,13 @@ public class ExpandableNotificationRowController {
mView.setOnDismissRunnable(mOnDismissRunnable);
mView.setDescendantFocusability(ViewGroup.FOCUS_BLOCK_DESCENDANTS);
if (mAllowLongPress) {
- mView.setLongPressListener(mNotificationGutsManager::openGuts);
+ mView.setLongPressListener((v, x, y, item) -> {
+ if (mView.isSummaryWithChildren()) {
+ mView.expandNotification();
+ return true;
+ }
+ return mNotificationGutsManager.openGuts(v, x, y, item);
+ });
}
if (ENABLE_REMOTE_INPUT) {
mView.setDescendantFocusability(ViewGroup.FOCUS_BEFORE_DESCENDANTS);