Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +6 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb updateMovementBounds(null /* toBounds */, false /* fromRotation */, false /* fromImeAdjustment */, false /* fromShelfAdjustment */, null /* windowContainerTransaction */); } else { // when we enter pip for the first time, the destination bounds and pip // bounds will already match, since they are calculated prior to // starting the animation, so we only need to update the min/max size // that is used for e.g. double tap to maximized state mTouchHandler.updateMinMaxSize(ratio); } } Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +22 −7 Original line number Diff line number Diff line Loading @@ -412,13 +412,7 @@ public class PipTouchHandler { mPipBoundsState.getExpandedBounds(), insetBounds, expandedMovementBounds, bottomOffset); if (mPipResizeGestureHandler.isUsingPinchToZoom()) { updatePinchResizeSizeConstraints(insetBounds, normalBounds, aspectRatio); } else { mPipResizeGestureHandler.updateMinSize(normalBounds.width(), normalBounds.height()); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getExpandedBounds().width(), mPipBoundsState.getExpandedBounds().height()); } updatePipSizeConstraints(insetBounds, normalBounds, aspectRatio); // The extra offset does not really affect the movement bounds, but are applied based on the // current state (ime showing, or shelf offset) when we need to actually shift Loading Loading @@ -487,6 +481,27 @@ public class PipTouchHandler { } } /** * Update the values for min/max allowed size of picture in picture window based on the aspect * ratio. * @param aspectRatio aspect ratio to use for the calculation of min/max size */ public void updateMinMaxSize(float aspectRatio) { updatePipSizeConstraints(mInsetBounds, mPipBoundsState.getNormalBounds(), aspectRatio); } private void updatePipSizeConstraints(Rect insetBounds, Rect normalBounds, float aspectRatio) { if (mPipResizeGestureHandler.isUsingPinchToZoom()) { updatePinchResizeSizeConstraints(insetBounds, normalBounds, aspectRatio); } else { mPipResizeGestureHandler.updateMinSize(normalBounds.width(), normalBounds.height()); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getExpandedBounds().width(), mPipBoundsState.getExpandedBounds().height()); } } private void updatePinchResizeSizeConstraints(Rect insetBounds, Rect normalBounds, float aspectRatio) { final int shorterLength = Math.min(mPipBoundsState.getDisplayBounds().width(), Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +6 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,12 @@ public class PipController implements PipTransitionController.PipTransitionCallb updateMovementBounds(null /* toBounds */, false /* fromRotation */, false /* fromImeAdjustment */, false /* fromShelfAdjustment */, null /* windowContainerTransaction */); } else { // when we enter pip for the first time, the destination bounds and pip // bounds will already match, since they are calculated prior to // starting the animation, so we only need to update the min/max size // that is used for e.g. double tap to maximized state mTouchHandler.updateMinMaxSize(ratio); } } Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipTouchHandler.java +22 −7 Original line number Diff line number Diff line Loading @@ -412,13 +412,7 @@ public class PipTouchHandler { mPipBoundsState.getExpandedBounds(), insetBounds, expandedMovementBounds, bottomOffset); if (mPipResizeGestureHandler.isUsingPinchToZoom()) { updatePinchResizeSizeConstraints(insetBounds, normalBounds, aspectRatio); } else { mPipResizeGestureHandler.updateMinSize(normalBounds.width(), normalBounds.height()); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getExpandedBounds().width(), mPipBoundsState.getExpandedBounds().height()); } updatePipSizeConstraints(insetBounds, normalBounds, aspectRatio); // The extra offset does not really affect the movement bounds, but are applied based on the // current state (ime showing, or shelf offset) when we need to actually shift Loading Loading @@ -487,6 +481,27 @@ public class PipTouchHandler { } } /** * Update the values for min/max allowed size of picture in picture window based on the aspect * ratio. * @param aspectRatio aspect ratio to use for the calculation of min/max size */ public void updateMinMaxSize(float aspectRatio) { updatePipSizeConstraints(mInsetBounds, mPipBoundsState.getNormalBounds(), aspectRatio); } private void updatePipSizeConstraints(Rect insetBounds, Rect normalBounds, float aspectRatio) { if (mPipResizeGestureHandler.isUsingPinchToZoom()) { updatePinchResizeSizeConstraints(insetBounds, normalBounds, aspectRatio); } else { mPipResizeGestureHandler.updateMinSize(normalBounds.width(), normalBounds.height()); mPipResizeGestureHandler.updateMaxSize(mPipBoundsState.getExpandedBounds().width(), mPipBoundsState.getExpandedBounds().height()); } } private void updatePinchResizeSizeConstraints(Rect insetBounds, Rect normalBounds, float aspectRatio) { final int shorterLength = Math.min(mPipBoundsState.getDisplayBounds().width(), Loading