mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-28 07:46:55 +00:00
Allow TouchControllers to override shouldDisableGestures
Currently only StatusBarTouchController overrides this to always return false, so that you can swipe down for notifications during transition to home screen from an app (in gesture nav). Bug: 137161198 Change-Id: I803c37937d5294810cbe0c1bbffcd5dddcc5ca3b
This commit is contained in:
@@ -21,7 +21,6 @@ import static android.view.MotionEvent.ACTION_DOWN;
|
||||
import static android.view.MotionEvent.ACTION_UP;
|
||||
|
||||
import static com.android.launcher3.Utilities.SINGLE_FRAME_MS;
|
||||
import static com.android.launcher3.Utilities.shouldDisableGestures;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.content.Context;
|
||||
@@ -30,7 +29,6 @@ import android.graphics.Rect;
|
||||
import android.graphics.RectF;
|
||||
import android.os.Build;
|
||||
import android.util.AttributeSet;
|
||||
import android.util.Log;
|
||||
import android.util.Property;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
@@ -152,15 +150,17 @@ public abstract class BaseDragLayer<T extends Context & ActivityContext>
|
||||
}
|
||||
|
||||
private TouchController findControllerToHandleTouch(MotionEvent ev) {
|
||||
if (shouldDisableGestures(ev)) return null;
|
||||
boolean gesturesEnabled = !Utilities.shouldDisableGestures(ev);
|
||||
|
||||
AbstractFloatingView topView = AbstractFloatingView.getTopOpenView(mActivity);
|
||||
if (topView != null && topView.onControllerInterceptTouchEvent(ev)) {
|
||||
if (topView != null && (gesturesEnabled || topView.allowWhenGesturesDisabled())
|
||||
&& topView.onControllerInterceptTouchEvent(ev)) {
|
||||
return topView;
|
||||
}
|
||||
|
||||
for (TouchController controller : mControllers) {
|
||||
if (controller.onControllerInterceptTouchEvent(ev)) {
|
||||
if ((gesturesEnabled || controller.allowWhenGesturesDisabled())
|
||||
&& controller.onControllerInterceptTouchEvent(ev)) {
|
||||
return controller;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user