Loading libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsAlgorithm.java +2 −19 Original line number Diff line number Diff line Loading @@ -365,30 +365,12 @@ public class PipBoundsAlgorithm implements PipDisplayLayoutState.DisplayIdListen mPipDisplayLayoutState.getDisplayLayout() /* displayLayout */); } /** * @return the movement bounds for the given stackBounds and the current state of the * controller. */ public Rect getMovementBounds(Rect stackBounds, boolean adjustForIme) { return getMovementBounds(stackBounds, adjustForIme, mPipDisplayLayoutState.getDisplayLayout() /* displayLayout */); } /** * @return the movement bounds for the given stackBounds on a given displayLayout and the * current state of the controller. */ public Rect getMovementBounds(Rect stackBounds, DisplayLayout displayLayout) { return getMovementBounds(stackBounds, true /* adjustForIme */, displayLayout); } /** * @return the movement bounds for the given stackBounds on a given displayLayout and the * current state of the controller. */ public Rect getMovementBounds(Rect stackBounds, boolean adjustForIme, DisplayLayout displayLayout) { // TODO(b/415107549): Refactor and reduce the number of `getMovementBounds()` overrides final Rect movementBounds = new Rect(); getInsetBounds(movementBounds, displayLayout); Loading Loading @@ -507,7 +489,8 @@ public class PipBoundsAlgorithm implements PipDisplayLayoutState.DisplayIdListen */ public void snapToMovementBoundsEdge(Rect bounds, DisplayLayout displayLayout) { // Get the movement bounds of the display final Rect movementBounds = getMovementBounds(bounds, displayLayout); final Rect movementBounds = getMovementBounds(bounds, true /* adjustForIme */, displayLayout); final int leftEdge = bounds.left; final int fromLeft = Math.abs(leftEdge - movementBounds.left); Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +4 −2 Original line number Diff line number Diff line Loading @@ -848,7 +848,8 @@ public class PipController implements PipTransitionController.PipTransitionCallb // Calculate the PiP bounds in the new orientation based on same fraction along the // rotated movement bounds. final Rect postChangeMovementBounds = mPipBoundsAlgorithm.getMovementBounds( postChangeBounds, false /* adjustForIme */); postChangeBounds, false /* adjustForIme */, mPipDisplayLayoutState.getDisplayLayout()); pipSnapAlgorithm.applySnapFraction(postChangeBounds, postChangeMovementBounds, snapFraction, mPipBoundsState.getStashedState(), mPipBoundsState.getStashOffset(), Loading Loading @@ -1201,7 +1202,8 @@ public class PipController implements PipTransitionController.PipTransitionCallb // Calculate the stack bounds in the new orientation based on same fraction along the // rotated movement bounds. final Rect postChangeMovementBounds = mPipBoundsAlgorithm.getMovementBounds( postChangeStackBounds, false /* adjustForIme */); postChangeStackBounds, false /* adjustForIme */, mPipDisplayLayoutState.getDisplayLayout()); pipSnapAlgorithm.applySnapFraction(postChangeStackBounds, postChangeMovementBounds, snapFraction, mPipBoundsState.getStashedState(), mPipBoundsState.getStashOffset(), mPipDisplayLayoutState.getDisplayBounds(), Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipBoundsAlgorithm.java +2 −19 Original line number Diff line number Diff line Loading @@ -365,30 +365,12 @@ public class PipBoundsAlgorithm implements PipDisplayLayoutState.DisplayIdListen mPipDisplayLayoutState.getDisplayLayout() /* displayLayout */); } /** * @return the movement bounds for the given stackBounds and the current state of the * controller. */ public Rect getMovementBounds(Rect stackBounds, boolean adjustForIme) { return getMovementBounds(stackBounds, adjustForIme, mPipDisplayLayoutState.getDisplayLayout() /* displayLayout */); } /** * @return the movement bounds for the given stackBounds on a given displayLayout and the * current state of the controller. */ public Rect getMovementBounds(Rect stackBounds, DisplayLayout displayLayout) { return getMovementBounds(stackBounds, true /* adjustForIme */, displayLayout); } /** * @return the movement bounds for the given stackBounds on a given displayLayout and the * current state of the controller. */ public Rect getMovementBounds(Rect stackBounds, boolean adjustForIme, DisplayLayout displayLayout) { // TODO(b/415107549): Refactor and reduce the number of `getMovementBounds()` overrides final Rect movementBounds = new Rect(); getInsetBounds(movementBounds, displayLayout); Loading Loading @@ -507,7 +489,8 @@ public class PipBoundsAlgorithm implements PipDisplayLayoutState.DisplayIdListen */ public void snapToMovementBoundsEdge(Rect bounds, DisplayLayout displayLayout) { // Get the movement bounds of the display final Rect movementBounds = getMovementBounds(bounds, displayLayout); final Rect movementBounds = getMovementBounds(bounds, true /* adjustForIme */, displayLayout); final int leftEdge = bounds.left; final int fromLeft = Math.abs(leftEdge - movementBounds.left); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +4 −2 Original line number Diff line number Diff line Loading @@ -848,7 +848,8 @@ public class PipController implements PipTransitionController.PipTransitionCallb // Calculate the PiP bounds in the new orientation based on same fraction along the // rotated movement bounds. final Rect postChangeMovementBounds = mPipBoundsAlgorithm.getMovementBounds( postChangeBounds, false /* adjustForIme */); postChangeBounds, false /* adjustForIme */, mPipDisplayLayoutState.getDisplayLayout()); pipSnapAlgorithm.applySnapFraction(postChangeBounds, postChangeMovementBounds, snapFraction, mPipBoundsState.getStashedState(), mPipBoundsState.getStashOffset(), Loading Loading @@ -1201,7 +1202,8 @@ public class PipController implements PipTransitionController.PipTransitionCallb // Calculate the stack bounds in the new orientation based on same fraction along the // rotated movement bounds. final Rect postChangeMovementBounds = mPipBoundsAlgorithm.getMovementBounds( postChangeStackBounds, false /* adjustForIme */); postChangeStackBounds, false /* adjustForIme */, mPipDisplayLayoutState.getDisplayLayout()); pipSnapAlgorithm.applySnapFraction(postChangeStackBounds, postChangeMovementBounds, snapFraction, mPipBoundsState.getStashedState(), mPipBoundsState.getStashOffset(), mPipDisplayLayoutState.getDisplayBounds(), Loading