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

Commit b423edcc 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...

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

Change-Id: Ifde7b2be6fe6111fe43c78b5766d3eb6f51b3f99
parents 784c88f8 f40c627d
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