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

Commit 7335c8b4 authored by Adrian Roos's avatar Adrian Roos Committed by android-build-merger
Browse files

DirectReply: Close if touching outside status bar am: 6d53de63

am: e6395f8a

Change-Id: Icb978071074bc204365fe7378776ac8377ad02f1
parents 32eed0e5 e6395f8a
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -750,6 +750,7 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            @Override
            public boolean onTouch(View v, MotionEvent event) {
                checkUserAutohide(v, event);
                checkRemoteInputOutside(event);
                if (event.getAction() == MotionEvent.ACTION_DOWN) {
                    if (mExpandedVisible) {
                        animateCollapsePanels();
@@ -3290,6 +3291,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        }
    }

    private void checkRemoteInputOutside(MotionEvent event) {
        if (event.getAction() == MotionEvent.ACTION_OUTSIDE // touch outside the source bar
                && event.getX() == 0 && event.getY() == 0  // a touch outside both bars
                && mRemoteInputController.isRemoteInputActive()) {
            mRemoteInputController.closeRemoteInputs();
        }
    }

    private void userAutohide() {
        cancelAutohide();
        mHandler.postDelayed(mAutohide, 350); // longer than app gesture -> flag clear