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

Commit 38c5f1fd authored by Shawn Lin's avatar Shawn Lin Committed by android-build-merger
Browse files

Merge "Not showing menu buttons for any headsup notification" into qt-dev

am: 7ad66d5e

Change-Id: I9b654373bab71c965502308631c05c6e2313874f
parents 08fadf2e 7ad66d5e
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -915,7 +915,8 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
            if (child.getVisibility() != View.GONE
                    && child instanceof ExpandableNotificationRow) {
                ExpandableNotificationRow row = (ExpandableNotificationRow) child;
                if ((row.isPinned() || row.isHeadsUpAnimatingAway()) && row.getTranslation() < 0) {
                if ((row.isPinned() || row.isHeadsUpAnimatingAway()) && row.getTranslation() < 0
                        && row.getProvider().shouldShowGutsOnSnapOpen()) {
                    top = Math.min(top, row.getTranslationY());
                    bottom = Math.max(bottom, row.getTranslationY() + row.getActualHeight());
                }
@@ -4380,6 +4381,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        mStackScrollAlgorithm.setIsExpanded(isExpanded);
        mAmbientState.setShadeExpanded(isExpanded);
        mStateAnimator.setShadeExpanded(isExpanded);
        mSwipeHelper.setIsExpanded(isExpanded);
        if (changed) {
            if (!mIsExpanded) {
                mGroupManager.collapseAllGroups();
+8 −1
Original line number Diff line number Diff line
@@ -48,6 +48,7 @@ class NotificationSwipeHelper extends SwipeHelper
    private static final long SWIPE_MENU_TIMING = 200;

    private NotificationMenuRowPlugin mCurrMenuRow;
    private boolean mIsExpanded;

    public NotificationSwipeHelper(int swipeDirection, NotificationCallback callback,
            Context context, NotificationMenuRowPlugin.OnMenuEventListener menuListener) {
@@ -97,6 +98,10 @@ class NotificationSwipeHelper extends SwipeHelper
        return mFalsingCheck;
    }

    public void setIsExpanded(boolean isExpanded) {
        mIsExpanded = isExpanded;
    }

    @Override
    protected void onChildSnappedBack(View animView, float targetLeft) {
        if (mCurrMenuRow != null && targetLeft == 0) {
@@ -200,7 +205,9 @@ class NotificationSwipeHelper extends SwipeHelper
        boolean slowSwipedFarEnough = swipedEnoughToShowMenu(menuRow) && isSlowSwipe;
        boolean isFastNonDismissGesture =
                gestureFastEnough && !gestureTowardsMenu && !isDismissGesture;
        boolean isMenuRevealingGestureAwayFromMenu = slowSwipedFarEnough || isFastNonDismissGesture;
        boolean isAbleToShowMenu = menuRow.shouldShowGutsOnSnapOpen() || mIsExpanded;
        boolean isMenuRevealingGestureAwayFromMenu = slowSwipedFarEnough
                || (isFastNonDismissGesture && isAbleToShowMenu);
        int menuSnapTarget = menuRow.getMenuSnapTarget();
        boolean isNonFalseMenuRevealingGesture =
                !isFalseGesture(ev) && isMenuRevealingGestureAwayFromMenu;