Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 684c8817 authored by Julia Reynolds's avatar Julia Reynolds
Browse files

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
parent a131a0c6
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -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).
+7 −1
Original line number Diff line number Diff line
@@ -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);