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

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

Finishing up heads up changes

Fixed a bug where the QS could be expanded when collapsed.
More refactorings, removed todos

Change-Id: I6dea262456c529d7f4a8a4a6a4fdc0e46597bafe
parent aac93259
Loading
Loading
Loading
Loading
+5 −6
Original line number Original line Diff line number Diff line
@@ -537,7 +537,7 @@ public class NotificationPanelView extends PanelView implements
            mExpansionIsFromHeadsUp = true;
            mExpansionIsFromHeadsUp = true;
            return true;
            return true;
        }
        }
        if (onQsIntercept(event)) {
        if (!isShadeCollapsed() && onQsIntercept(event)) {
            return true;
            return true;
        }
        }
        return super.onInterceptTouchEvent(event);
        return super.onInterceptTouchEvent(event);
@@ -708,7 +708,7 @@ public class NotificationPanelView extends PanelView implements
            mInitialTouchY = event.getX();
            mInitialTouchY = event.getX();
            mInitialTouchX = event.getY();
            mInitialTouchX = event.getY();
        }
        }
        if (mExpandedHeight != 0) {
        if (!isShadeCollapsed()) {
            handleQsDown(event);
            handleQsDown(event);
        }
        }
        if (!mQsExpandImmediate && mQsTracking) {
        if (!mQsExpandImmediate && mQsTracking) {
@@ -1446,7 +1446,7 @@ public class NotificationPanelView extends PanelView implements
        updateHeader();
        updateHeader();
        updateUnlockIcon();
        updateUnlockIcon();
        updateNotificationTranslucency();
        updateNotificationTranslucency();
        mHeadsUpManager.setIsExpanded(expandedHeight != 0);
        mHeadsUpManager.setIsExpanded(!isShadeCollapsed());
        mNotificationStackScroller.setShadeExpanded(!isShadeCollapsed());
        mNotificationStackScroller.setShadeExpanded(!isShadeCollapsed());
        if (DEBUG) {
        if (DEBUG) {
            invalidate();
            invalidate();
@@ -1668,8 +1668,7 @@ public class NotificationPanelView extends PanelView implements
        mHeadsUpManager.onExpandingFinished();
        mHeadsUpManager.onExpandingFinished();
        mIsExpanding = false;
        mIsExpanding = false;
        mScrollYOverride = -1;
        mScrollYOverride = -1;
        // TODO: look into whether this is still correct
        if (isShadeCollapsed()) {
        if (mExpandedHeight == 0f) {
            setListening(false);
            setListening(false);
        } else {
        } else {
            setListening(true);
            setListening(true);
@@ -2171,7 +2170,7 @@ public class NotificationPanelView extends PanelView implements


    @Override
    @Override
    protected boolean isShadeCollapsed() {
    protected boolean isShadeCollapsed() {
        return mExpandedHeight == 0 || mHeadsUpManager.hasPinnedHeadsUp();
        return mExpandedHeight == 0;
    }
    }


    @Override
    @Override
+4 −5
Original line number Original line Diff line number Diff line
@@ -234,7 +234,7 @@ public abstract class PanelView extends FrameLayout {
        final float y = event.getY(pointerIndex);
        final float y = event.getY(pointerIndex);


        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
        if (event.getActionMasked() == MotionEvent.ACTION_DOWN) {
            mGestureWaitForTouchSlop = mExpandedHeight == 0f;
            mGestureWaitForTouchSlop = isShadeCollapsed();
        }
        }
        boolean waitForTouchSlop = hasConflictingGestures() || mGestureWaitForTouchSlop;
        boolean waitForTouchSlop = hasConflictingGestures() || mGestureWaitForTouchSlop;


@@ -242,7 +242,7 @@ public abstract class PanelView extends FrameLayout {
            case MotionEvent.ACTION_DOWN:
            case MotionEvent.ACTION_DOWN:
                startExpandMotion(x, y, false /* startTracking */, mExpandedHeight);
                startExpandMotion(x, y, false /* startTracking */, mExpandedHeight);
                mJustPeeked = false;
                mJustPeeked = false;
                mPanelClosedOnDown = mExpandedHeight == 0.0f;
                mPanelClosedOnDown = isShadeCollapsed();
                mHasLayoutedSinceDown = false;
                mHasLayoutedSinceDown = false;
                mUpdateFlingOnLayout = false;
                mUpdateFlingOnLayout = false;
                mMotionAborted = false;
                mMotionAborted = false;
@@ -260,7 +260,7 @@ public abstract class PanelView extends FrameLayout {
                            || mPeekPending || mPeekAnimator != null;
                            || mPeekPending || mPeekAnimator != null;
                    onTrackingStarted();
                    onTrackingStarted();
                }
                }
                if (mExpandedHeight == 0) {
                if (isShadeCollapsed()) {
                    schedulePeek();
                    schedulePeek();
                }
                }
                break;
                break;
@@ -448,7 +448,7 @@ public abstract class PanelView extends FrameLayout {
                mTouchSlopExceeded = false;
                mTouchSlopExceeded = false;
                mJustPeeked = false;
                mJustPeeked = false;
                mMotionAborted = false;
                mMotionAborted = false;
                mPanelClosedOnDown = mExpandedHeight == 0.0f;
                mPanelClosedOnDown = isShadeCollapsed();
                mHasLayoutedSinceDown = false;
                mHasLayoutedSinceDown = false;
                mUpdateFlingOnLayout = false;
                mUpdateFlingOnLayout = false;
                mTouchAboveFalsingThreshold = false;
                mTouchAboveFalsingThreshold = false;
@@ -730,7 +730,6 @@ public abstract class PanelView extends FrameLayout {
    }
    }


    public boolean isFullyCollapsed() {
    public boolean isFullyCollapsed() {
        // TODO: look into whether this is still correct with HUN's
        return mExpandedHeight <= 0;
        return mExpandedHeight <= 0;
    }
    }