Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class PipResizeGestureHandler { // For pinch-resize // For pinch-resize private boolean mThresholdCrossed0; private boolean mThresholdCrossed0; private boolean mThresholdCrossed1; private boolean mThresholdCrossed1; private boolean mUsingPinchToZoom = true; private boolean mOngoingPinchToResize = false; private float mAngle = 0; private float mAngle = 0; int mFirstIndex = -1; int mFirstIndex = -1; int mSecondIndex = -1; int mSecondIndex = -1; Loading Loading @@ -236,7 +236,7 @@ public class PipResizeGestureHandler { } } if (ev instanceof MotionEvent) { if (ev instanceof MotionEvent) { if (mUsingPinchToZoom) { if (mOngoingPinchToResize) { onPinchResize((MotionEvent) ev); onPinchResize((MotionEvent) ev); } else { } else { onDragCornerResize((MotionEvent) ev); onDragCornerResize((MotionEvent) ev); Loading @@ -248,7 +248,7 @@ public class PipResizeGestureHandler { * Checks if there is currently an on-going gesture, either drag-resize or pinch-resize. * Checks if there is currently an on-going gesture, either drag-resize or pinch-resize. */ */ public boolean hasOngoingGesture() { public boolean hasOngoingGesture() { return mCtrlType != CTRL_NONE || mUsingPinchToZoom; return mCtrlType != CTRL_NONE || mOngoingPinchToResize; } } /** /** Loading Loading @@ -305,7 +305,7 @@ 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); mUsingPinchToZoom = true; mOngoingPinchToResize = true; return true; return true; } } break; break; Loading Loading @@ -587,7 +587,7 @@ public class PipResizeGestureHandler { // Pinch-to-resize needs to re-calculate snap fraction and animate to the snapped // Pinch-to-resize needs to re-calculate snap fraction and animate to the snapped // position correctly. Drag-resize does not need to move, so just finalize resize. // position correctly. Drag-resize does not need to move, so just finalize resize. if (mUsingPinchToZoom) { if (mOngoingPinchToResize) { final Rect startBounds = new Rect(mLastResizeBounds); final Rect startBounds = new Rect(mLastResizeBounds); // If user resize is pretty close to max size, just auto resize to max. // If user resize is pretty close to max size, just auto resize to max. if (mLastResizeBounds.width() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.x if (mLastResizeBounds.width() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.x Loading @@ -612,7 +612,7 @@ public class PipResizeGestureHandler { private void resetState() { private void resetState() { mCtrlType = CTRL_NONE; mCtrlType = CTRL_NONE; mAngle = 0; mAngle = 0; mUsingPinchToZoom = false; mOngoingPinchToResize = false; mAllowGesture = false; mAllowGesture = false; mThresholdCrossed = false; mThresholdCrossed = false; } } Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipResizeGestureHandler.java +6 −6 Original line number Original line Diff line number Diff line Loading @@ -108,7 +108,7 @@ public class PipResizeGestureHandler { // For pinch-resize // For pinch-resize private boolean mThresholdCrossed0; private boolean mThresholdCrossed0; private boolean mThresholdCrossed1; private boolean mThresholdCrossed1; private boolean mUsingPinchToZoom = true; private boolean mOngoingPinchToResize = false; private float mAngle = 0; private float mAngle = 0; int mFirstIndex = -1; int mFirstIndex = -1; int mSecondIndex = -1; int mSecondIndex = -1; Loading Loading @@ -236,7 +236,7 @@ public class PipResizeGestureHandler { } } if (ev instanceof MotionEvent) { if (ev instanceof MotionEvent) { if (mUsingPinchToZoom) { if (mOngoingPinchToResize) { onPinchResize((MotionEvent) ev); onPinchResize((MotionEvent) ev); } else { } else { onDragCornerResize((MotionEvent) ev); onDragCornerResize((MotionEvent) ev); Loading @@ -248,7 +248,7 @@ public class PipResizeGestureHandler { * Checks if there is currently an on-going gesture, either drag-resize or pinch-resize. * Checks if there is currently an on-going gesture, either drag-resize or pinch-resize. */ */ public boolean hasOngoingGesture() { public boolean hasOngoingGesture() { return mCtrlType != CTRL_NONE || mUsingPinchToZoom; return mCtrlType != CTRL_NONE || mOngoingPinchToResize; } } /** /** Loading Loading @@ -305,7 +305,7 @@ 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); mUsingPinchToZoom = true; mOngoingPinchToResize = true; return true; return true; } } break; break; Loading Loading @@ -587,7 +587,7 @@ public class PipResizeGestureHandler { // Pinch-to-resize needs to re-calculate snap fraction and animate to the snapped // Pinch-to-resize needs to re-calculate snap fraction and animate to the snapped // position correctly. Drag-resize does not need to move, so just finalize resize. // position correctly. Drag-resize does not need to move, so just finalize resize. if (mUsingPinchToZoom) { if (mOngoingPinchToResize) { final Rect startBounds = new Rect(mLastResizeBounds); final Rect startBounds = new Rect(mLastResizeBounds); // If user resize is pretty close to max size, just auto resize to max. // If user resize is pretty close to max size, just auto resize to max. if (mLastResizeBounds.width() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.x if (mLastResizeBounds.width() >= PINCH_RESIZE_AUTO_MAX_RATIO * mMaxSize.x Loading @@ -612,7 +612,7 @@ public class PipResizeGestureHandler { private void resetState() { private void resetState() { mCtrlType = CTRL_NONE; mCtrlType = CTRL_NONE; mAngle = 0; mAngle = 0; mUsingPinchToZoom = false; mOngoingPinchToResize = false; mAllowGesture = false; mAllowGesture = false; mThresholdCrossed = false; mThresholdCrossed = false; } } Loading