Merge "Change longpress behavior for summaries" into rvc-dev am: 0c4af24716

Change-Id: Ibc90f7ebce490c01e933c88e4fe04505773113f6
This commit is contained in:
Julia Reynolds
2020-05-06 13:21:24 +00:00
committed by Automerger Merge Worker
2 changed files with 12 additions and 1 deletions

View File

@@ -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).

View File

@@ -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);