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

Commit d3fbe683 authored by Jan-Willem Maarse's avatar Jan-Willem Maarse
Browse files

Ignore generic motion events if custom content doesn't allow scrolling

If the custom content screen is selected and it doesn't
allow scrolling, the workspace should ignore generic motion
events instead of trying to scroll to the next page.

Change-Id: Iee9c7e02bf7c78648b574a01c83dcb76c0b62855
parent 800a4f21
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -1114,6 +1114,17 @@ public class Workspace extends SmoothPagedView
        return super.onInterceptTouchEvent(ev);
    }

    @Override
    public boolean onGenericMotionEvent(MotionEvent event) {
        // Ignore pointer scroll events if the custom content doesn't allow scrolling.
        if ((getScreenIdForPageIndex(getCurrentPage()) == CUSTOM_CONTENT_SCREEN_ID)
                && (mCustomContentCallbacks != null)
                && !mCustomContentCallbacks.isScrollingAllowed()) {
            return false;
        }
        return super.onGenericMotionEvent(event);
    }

    protected void reinflateWidgetsIfNecessary() {
        final int clCount = getChildCount();
        for (int i = 0; i < clCount; i++) {