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

Commit bc5d9bb4 authored by Daniel Sandler's avatar Daniel Sandler
Browse files

More fixes to ensure that touches outside the panel close it.

Similarly, touches in the glow area surrounding the panel
title no longer switch into settings mode.

Bug: 3339023
Change-Id: I142e500a55ecfca24082c28e75e5e71c1524ad56
parent 961d2c6a
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -23,7 +23,6 @@
    android:orientation="vertical"
    android:background="@drawable/notify_panel_clock_bg"
    >

    <ImageView
        android:id="@+id/network_signal"
        android:layout_height="32dp"
@@ -150,4 +149,10 @@
        android:layout_marginLeft="32dp"
        />

    <Button
        android:id="@+id/mode_toggle"
        android:background="@null"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        />
</RelativeLayout>
+8 −6
Original line number Diff line number Diff line
@@ -47,6 +47,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,

    boolean mShowing;
    View mTitleArea;
    View mModeToggle;
    View mSettingsButton;
    View mNotificationButton;
    View mNotificationScroller;
@@ -75,7 +76,8 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
        mContentParent = (ViewGroup)findViewById(R.id.content_parent);
        mContentParent.bringToFront();
        mTitleArea = findViewById(R.id.title_area);
        mTitleArea.setOnClickListener(this);
        mModeToggle = findViewById(R.id.mode_toggle);
        mModeToggle.setOnClickListener(this);

        mScrim = findViewById(R.id.scrim);
        mGlow = findViewById(R.id.glow);
@@ -138,7 +140,7 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    }

    public void onClick(View v) {
        if (v == mTitleArea) {
        if (v == mModeToggle) {
            if (mSettingsView == null) {
                switchToSettingsMode();
            } else {
@@ -163,10 +165,10 @@ public class NotificationPanel extends RelativeLayout implements StatusBarPanel,
    }

    public boolean isInContentArea(int x, int y) {
        mContentArea.left = mContentFrame.getLeft();
        mContentArea.top = mTitleArea.getTop();
        mContentArea.right = mContentFrame.getRight();
        mContentArea.bottom = mContentFrame.getBottom();
        mContentArea.left = mContentFrame.getLeft() + mContentFrame.getPaddingLeft();
        mContentArea.top = mTitleArea.getTop() + mTitleArea.getPaddingTop();
        mContentArea.right = mContentFrame.getRight() - mContentFrame.getPaddingRight();
        mContentArea.bottom = mContentFrame.getBottom() - mContentFrame.getPaddingBottom();
        offsetDescendantRectToMyCoords(mContentParent, mContentArea);
        return mContentArea.contains(x, y);
    }