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

Commit fe6bfa64 authored by Jorim Jaggi's avatar Jorim Jaggi
Browse files

Only handle scroll events when over content.

This makes sure that the unlock text is always shown when tapping
the bottom area.

Bug: 14381296
Change-Id: If1729a01dab21ddf0b93e665c85fd72ed399c0fd
parent e96fcd1f
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -516,7 +516,7 @@ public class NotificationStackScrollLayout extends ViewGroup

        switch (action & MotionEvent.ACTION_MASK) {
            case MotionEvent.ACTION_DOWN: {
                if (getChildCount() == 0) {
                if (getChildCount() == 0 || !isInContentBounds(ev)) {
                    return false;
                }
                boolean isBeingDragged = !mScroller.isFinished();
@@ -1140,6 +1140,13 @@ public class NotificationStackScrollLayout extends ViewGroup
        return mIsBeingDragged;
    }

    /**
     * @return Whether the specified motion event is actually happening over the content.
     */
    private boolean isInContentBounds(MotionEvent event) {
        return event.getY() < getHeight() - getEmptyBottomMargin();
    }

    private void setIsBeingDragged(boolean isDragged) {
        mIsBeingDragged = isDragged;
        if (isDragged) {