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

Commit 6223fba8 authored by Joe Onorato's avatar Joe Onorato
Browse files

Remove optimization to isInContentArea that wasn't working.

This might fix the bug where tapping outside the notification panel doesn't close it.

I'm not 100% sure because I can't reproduce this on-demand, but I think it's possible for
onSizeChanged to race with the animations and we end up with a bad rectangle.  The time
I did see it happen was tapping above the title area right after canceling a notification,
so that could explain it I think.

Bug: 3339023
Change-Id: Ic3a7f4c059e7bf6f30b864a371a0912a6414edb7
parent cb109a0e
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -52,7 +52,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    View mNotificationScroller;
    View mNotificationGlow;
    ViewGroup mContentFrame;
    Rect mContentArea;
    Rect mContentArea = new Rect();
    View mSettingsView;
    View mScrim, mGlow;
    ViewGroup mContentParent;
@@ -136,7 +136,6 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    @Override
    public void onSizeChanged(int w, int h, int oldw, int oldh) {
        super.onSizeChanged(w, h, oldw, oldh);
        mContentArea = null;
    }

    public void onClick(View v) {
@@ -165,13 +164,11 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    }

    public boolean isInContentArea(int x, int y) {
        if (mContentArea == null) {
            mContentArea = new Rect(mContentFrame.getLeft(),
                    mTitleArea.getTop(),
                    mContentFrame.getRight(),
                    mContentFrame.getBottom());
        mContentArea.left = mContentFrame.getLeft();
        mContentArea.top = mTitleArea.getTop();
        mContentArea.right = mContentFrame.getRight();
        mContentArea.bottom = mContentFrame.getBottom();
        offsetDescendantRectToMyCoords(mContentParent, mContentArea);
        }
        return mContentArea.contains(x, y);
    }