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

Commit bae09ae8 authored by Priyank Singh's avatar Priyank Singh Committed by John Choi
Browse files

Single tap on the glass pane in notification shade should close the shade.

Bug: 130168660
Test: Manual
Change-Id: I7724ba08557db0f19dcbd0056bf248acab80368b
(cherry picked from commit 9dd6c788b02bf3f9dd79682aad6d783af1c2b298)
parent df91220f
Loading
Loading
Loading
Loading
+14 −5
Original line number Diff line number Diff line
@@ -485,10 +485,7 @@ public class CarStatusBar extends StatusBar implements
                    mNotificationListAtBottomAtTimeOfTouch = false;
                }

                boolean handled = false;
                if (mNotificationListAtBottomAtTimeOfTouch && mNotificationListAtBottom) {
                    handled = closeGestureDetector.onTouchEvent(event);
                }
                boolean handled = closeGestureDetector.onTouchEvent(event);
                boolean isTracking = mIsTracking;
                Rect rect = mNotificationList.getClipBounds();
                float clippedHeight = 0;
@@ -1036,9 +1033,19 @@ public class CarStatusBar extends StatusBar implements
    private abstract class CloseNotificationGestureListener extends
            GestureDetector.SimpleOnGestureListener {

        @Override
        public boolean onSingleTapUp(MotionEvent motionEvent) {
            animateNotificationPanel(DEFAULT_FLING_VELOCITY, true);
            return false;
        }

        @Override
        public boolean onScroll(MotionEvent event1, MotionEvent event2, float distanceX,
                float distanceY) {
            if (!mNotificationListAtBottomAtTimeOfTouch && !mNotificationListAtBottom) {
                return false;
            }
            // should not clip while scroll to the bottom of the list.
            if (!mNotificationListAtBottomAtTimeOfTouch) {
                return false;
            }
@@ -1074,7 +1081,9 @@ public class CarStatusBar extends StatusBar implements
        @Override
        public boolean onFling(MotionEvent event1, MotionEvent event2,
                float velocityX, float velocityY) {

            if (!mNotificationListAtBottomAtTimeOfTouch && !mNotificationListAtBottom) {
                return false;
            }
            if (Math.abs(event1.getX() - event2.getX()) > SWIPE_MAX_OFF_PATH
                    || Math.abs(velocityY) < SWIPE_THRESHOLD_VELOCITY) {
                // swipe was not vertical or was not fast enough