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

Commit 34cc5f45 authored by vadimt's avatar vadimt
Browse files

Allowing ListenerView intercept events in system areas

See the discussion in thje bug

Bug: 156044202
Change-Id: I68b3826602250ef163b96be95d80b98691456443
parent ad6a4dce
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;
    }
}