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

Commit 28f0e593 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Edge swipes should also dismiss notifications

To prevent falsing with phone/camera affordance.

Bug: 16571057
Change-Id: I5da5efc5529af8211357b556f1db4858e8775e05
parent ce0c13a1
Loading
Loading
Loading
Loading
+13 −4
Original line number Diff line number Diff line
@@ -384,11 +384,20 @@ public class SwipeHelper implements Gefingerpoken {
        }

        if (!mDragging) {
            if (mCallback.getChildAtPosition(ev) != null) {

                // We are dragging directly over a card, make sure that we also catch the gesture
                // even if nobody else wants the touch event.
                onInterceptTouchEvent(ev);
                return true;
            } else {

                // We are not doing anything, make sure the long press callback
                // is not still ticking like a bomb waiting to go off.
                removeLongPressCallback();
                return false;
            }
        }

        mVelocityTracker.addMovement(ev);
        final int action = ev.getAction();
+1 −1
Original line number Diff line number Diff line
@@ -98,7 +98,7 @@ public class KeyguardAffordanceHelper {

    private void initDimens() {
        final ViewConfiguration configuration = ViewConfiguration.get(mContext);
        mTouchSlop = configuration.getScaledTouchSlop();
        mTouchSlop = configuration.getScaledPagingTouchSlop();
        mMinFlingVelocity = configuration.getScaledMinimumFlingVelocity();
        mMinTranslationAmount = mContext.getResources().getDimensionPixelSize(
                R.dimen.keyguard_min_swipe_amount);
+5 −2
Original line number Diff line number Diff line
@@ -568,8 +568,11 @@ public class NotificationStackScrollLayout extends ViewGroup
            float childTop = slidingChild.getTranslationY();
            float top = childTop + slidingChild.getClipTopAmount();
            float bottom = top + slidingChild.getActualHeight();
            int left = slidingChild.getLeft();
            int right = slidingChild.getRight();

            // Allow the full width of this view to prevent gesture conflict on Keyguard (phone and
            // camera affordance).
            int left = 0;
            int right = getWidth();

            if (touchY >= top && touchY <= bottom && touchX >= left && touchX <= right) {
                return slidingChild;