mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-19 18:58:19 +00:00
Merge "Allowing ListenerView intercept events in system areas" into ub-launcher3-rvc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
488044fc2e
@@ -257,4 +257,8 @@ public abstract class AbstractFloatingView extends LinearLayout implements Touch
|
||||
@FloatingViewType int type) {
|
||||
return getOpenView(activity, type);
|
||||
}
|
||||
|
||||
public boolean canInterceptEventsInSystemGestureRegion() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user