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

Commit 4869a55f authored by Adrian Roos's avatar Adrian Roos Committed by Android (Google) Code Review
Browse files

Merge "DirectReply: Close if touching outside status bar" into nyc-mr2-dev

parents fbe70a3e 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