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

Commit 488044fc authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Allowing ListenerView intercept events in system areas" into ub-launcher3-rvc-dev

parents 1b8f1cd2 34cc5f45
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -257,4 +257,8 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
            @FloatingViewType int type) {
        return getOpenView(activity, type);
    }

    public boolean canInterceptEventsInSystemGestureRegion() {
        return false;
    }
}
+6 −5
Original line number Diff line number Diff line
@@ -186,12 +186,13 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
                    + ", isEventInLauncher=" + isEventInLauncher(ev)
                    + ", topOpenView=" + AbstractFloatingView.getTopOpenView(mActivity));
        }
        if (isEventInLauncher(ev)) {

        AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
            if (topView != null && topView.onControllerInterceptTouchEvent(ev)) {
        if (topView != null
                && (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion())
                && topView.onControllerInterceptTouchEvent(ev)) {
            return topView;
        }
        }

        for (TouchController controller : mControllers) {
            if (controller.onControllerInterceptTouchEvent(ev)) {
+5 −0
Original line number Diff line number Diff line
@@ -106,4 +106,9 @@ public class ListenerView extends AbstractFloatingView {
        // We want other views to be able to intercept the touch so we return false here.
        return false;
    }

    @Override
    public boolean canInterceptEventsInSystemGestureRegion() {
        return true;
    }
}