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

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

DirectReply: Close if touching outside status bar

am: 6d53de63

Change-Id: I134abad75cae32c8eb9229ac8aa993f9bd71b667
parents 57c829c2 6d53de63
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -746,6 +746,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();
@@ -3205,6 +3206,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