Merge "Start pinchResize only if pointers are inside PIP" into sc-dev am: c6e212c5b2

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/14948317

Change-Id: Ie0f93793235892921790df65006ffa911e5d36f5
This commit is contained in:
Jorge Gil
2021-06-16 22:04:08 +00:00
committed by Automerger Merge Worker

View File

@@ -235,15 +235,20 @@ public class PipResizeGestureHandler {
@VisibleForTesting
void onInputEvent(InputEvent ev) {
if (!mEnableDragCornerResize && !mEnablePinchResize) {
// No need to handle anything if neither form of resizing is enabled.
return;
}
// Don't allow resize when PiP is stashed.
if (mPipBoundsState.isStashed()) {
return;
}
if (ev instanceof MotionEvent) {
if (mOngoingPinchToResize) {
if (mEnablePinchResize && mOngoingPinchToResize) {
onPinchResize((MotionEvent) ev);
} else {
} else if (mEnableDragCornerResize) {
onDragCornerResize((MotionEvent) ev);
}
}
@@ -318,8 +323,8 @@ public class PipResizeGestureHandler {
case MotionEvent.ACTION_POINTER_DOWN:
if (mEnablePinchResize && ev.getPointerCount() == 2) {
onPinchResize(ev);
mOngoingPinchToResize = true;
return true;
mOngoingPinchToResize = mAllowGesture;
return mAllowGesture;
}
break;