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

Commit aae9ad67 authored by Selim Cinek's avatar Selim Cinek
Browse files

Fixed the behavior when dragging down on home screen with a hun

Previously the headsupmanager wouldn't be informed about the update
and touches would not necessarily go through to the panelView
because we were still considered small.

Fixes: 138152555
Test: drag down on home while a hun is showing
Change-Id: I1d28e3df8ccac297a65424fe1c9401968a364ee6
parent 2738aa3f
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -184,4 +184,6 @@ public interface NotificationListContainer extends ExpandableView.OnHeightChange
    default boolean containsView(View v) {
        return true;
    }

    default void setWillExpand(boolean willExpand) {};
}
+8 −1
Original line number Diff line number Diff line
@@ -500,6 +500,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
    private boolean mAnimateBottomOnLayout;
    private float mLastSentAppear;
    private float mLastSentExpandedHeight;
    private boolean mWillExpand;

    @Inject
    public NotificationStackScrollLayout(
@@ -4398,6 +4399,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        mStateAnimator.setShadeExpanded(isExpanded);
        mSwipeHelper.setIsExpanded(isExpanded);
        if (changed) {
            mWillExpand = false;
            if (!mIsExpanded) {
                mGroupManager.collapseAllGroups();
                mExpandHelper.cancelImmediately();
@@ -5047,7 +5049,7 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        if (mAnimationsEnabled && (isHeadsUp || mHeadsUpGoingAwayAnimationsAllowed)) {
            mHeadsUpChangeAnimations.add(new Pair<>(row, isHeadsUp));
            mNeedsAnimation = true;
            if (!mIsExpanded && !isHeadsUp) {
            if (!mIsExpanded && !mWillExpand && !isHeadsUp) {
                row.setHeadsUpAnimatingAway(true);
            }
            requestChildrenUpdate();
@@ -5068,6 +5070,11 @@ public class NotificationStackScrollLayout extends ViewGroup implements ScrollAd
        requestChildrenUpdate();
    }

    @Override
    public void setWillExpand(boolean willExpand) {
        mWillExpand = willExpand;
    }

    @ShadeViewRefactor(RefactorComponent.SHADE_VIEW)
    public void setTrackingHeadsUp(ExpandableNotificationRow row) {
        mTrackingHeadsUp = row != null;
+2 −1
Original line number Diff line number Diff line
@@ -1278,6 +1278,7 @@ public class NotificationPanelView extends PanelView implements
        }
        mExpectingSynthesizedDown = true;
        onTrackingStarted();
        updatePanelExpanded();
    }

    /**
@@ -2029,7 +2030,7 @@ public class NotificationPanelView extends PanelView implements
    }

    private void updatePanelExpanded() {
        boolean isExpanded = !isFullyCollapsed();
        boolean isExpanded = !isFullyCollapsed() || mExpectingSynthesizedDown;
        if (mPanelExpanded != isExpanded) {
            mHeadsUpManager.setIsPanelExpanded(isExpanded);
            mStatusBar.setPanelExpanded(isExpanded);
+2 −1
Original line number Diff line number Diff line
@@ -1802,6 +1802,8 @@ public class StatusBar extends SystemUI implements DemoMode,
                    mVibratorHelper.vibrate(VibrationEffect.EFFECT_TICK);
                }
                mNotificationPanel.expand(true /* animate */);
                ((NotificationListContainer) mStackScroller).setWillExpand(true);
                mHeadsUpManager.unpinAll(true /* userUnpinned */);
                mMetricsLogger.count(NotificationPanelView.COUNTER_PANEL_OPEN, 1);
            } else if (!mNotificationPanel.isInSettings() && !mNotificationPanel.isExpanding()){
                mNotificationPanel.flingSettings(0 /* velocity */,
@@ -1939,7 +1941,6 @@ public class StatusBar extends SystemUI implements DemoMode,

        if (start) {
            mNotificationPanel.startWaitingForOpenPanelGesture();
            setPanelExpanded(true);
        } else {
            mNotificationPanel.stopWaitingForOpenPanelGesture(velocity);
        }