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

Commit 153d2538 authored by Jorge Gil's avatar Jorge Gil Committed by Automerger Merge Worker
Browse files

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

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

Change-Id: I588e7e4dd120b2c0aed21689af053463beb167ce
parents b5f595ce 2c8878f1
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -235,15 +235,20 @@ public class PipResizeGestureHandler {


    @VisibleForTesting
    @VisibleForTesting
    void onInputEvent(InputEvent ev) {
    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.
        // Don't allow resize when PiP is stashed.
        if (mPipBoundsState.isStashed()) {
        if (mPipBoundsState.isStashed()) {
            return;
            return;
        }
        }


        if (ev instanceof MotionEvent) {
        if (ev instanceof MotionEvent) {
            if (mOngoingPinchToResize) {
            if (mEnablePinchResize && mOngoingPinchToResize) {
                onPinchResize((MotionEvent) ev);
                onPinchResize((MotionEvent) ev);
            } else {
            } else if (mEnableDragCornerResize) {
                onDragCornerResize((MotionEvent) ev);
                onDragCornerResize((MotionEvent) ev);
            }
            }
        }
        }
@@ -318,8 +323,8 @@ public class PipResizeGestureHandler {
                case MotionEvent.ACTION_POINTER_DOWN:
                case MotionEvent.ACTION_POINTER_DOWN:
                    if (mEnablePinchResize && ev.getPointerCount() == 2) {
                    if (mEnablePinchResize && ev.getPointerCount() == 2) {
                        onPinchResize(ev);
                        onPinchResize(ev);
                        mOngoingPinchToResize = true;
                        mOngoingPinchToResize = mAllowGesture;
                        return true;
                        return mAllowGesture;
                    }
                    }
                    break;
                    break;