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

Commit f40c627d authored by Priyank Singh's avatar Priyank Singh Committed by android-build-merger
Browse files

Merge "Single tap on the glass pane in notification shade should close the shade." into qt-dev

am: e4be3cdb

Change-Id: Ide1f141ce0ee08d1c6c23e9aca1f614e91bb04ca
parents 8e391042 e4be3cdb
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