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

This commit is contained in:
TreeHugger Robot
2020-06-05 16:36:38 +00:00
committed by Android (Google) Code Review
3 changed files with 15 additions and 5 deletions

View File

@@ -257,4 +257,8 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
@FloatingViewType int type) {
return getOpenView(activity, type);
}
public boolean canInterceptEventsInSystemGestureRegion() {
return false;
}
}

View File

@@ -186,11 +186,12 @@ 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)) {
return topView;
}
AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
if (topView != null
&& (isEventInLauncher(ev) || topView.canInterceptEventsInSystemGestureRegion())
&& topView.onControllerInterceptTouchEvent(ev)) {
return topView;
}
for (TouchController controller : mControllers) {

View File

@@ -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;
}
}