Loading libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +13 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac private final DisplayInfo mTmpDisplayInfo = new DisplayInfo(); private final Rect mTmpInsetBounds = new Rect(); private final Rect mTmpNormalBounds = new Rect(); protected final Rect mReentryBounds = new Rect(); private DisplayController mDisplayController; private PipAppOpsListener mAppOpsListener; Loading Loading @@ -401,7 +402,8 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac public void onPipTransitionStarted(ComponentName activity, int direction, Rect pipBounds) { if (isOutPipDirection(direction)) { // Exiting PIP, save the reentry bounds to restore to when re-entering. mPipBoundsHandler.onSaveReentryBounds(activity, pipBounds); updateReentryBounds(pipBounds); mPipBoundsHandler.onSaveReentryBounds(activity, mReentryBounds); } // Disable touches while the animation is running mTouchHandler.setTouchEnabled(false); Loading @@ -410,6 +412,16 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac } } /** * Update the bounds used to save the re-entry size and snap fraction when exiting PIP. */ public void updateReentryBounds(Rect bounds) { final Rect reentryBounds = mTouchHandler.getUserResizeBounds(); float snapFraction = mPipBoundsHandler.getSnapFraction(bounds); mPipBoundsHandler.applySnapFraction(reentryBounds, snapFraction); mReentryBounds.set(reentryBounds); } @Override public void onPipTransitionFinished(ComponentName activity, int direction) { onPipTransitionFinishedOrCanceled(direction); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/pip/phone/PipController.java +13 −1 Original line number Diff line number Diff line Loading @@ -63,6 +63,7 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac private final DisplayInfo mTmpDisplayInfo = new DisplayInfo(); private final Rect mTmpInsetBounds = new Rect(); private final Rect mTmpNormalBounds = new Rect(); protected final Rect mReentryBounds = new Rect(); private DisplayController mDisplayController; private PipAppOpsListener mAppOpsListener; Loading Loading @@ -401,7 +402,8 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac public void onPipTransitionStarted(ComponentName activity, int direction, Rect pipBounds) { if (isOutPipDirection(direction)) { // Exiting PIP, save the reentry bounds to restore to when re-entering. mPipBoundsHandler.onSaveReentryBounds(activity, pipBounds); updateReentryBounds(pipBounds); mPipBoundsHandler.onSaveReentryBounds(activity, mReentryBounds); } // Disable touches while the animation is running mTouchHandler.setTouchEnabled(false); Loading @@ -410,6 +412,16 @@ public class PipController implements Pip, PipTaskOrganizer.PipTransitionCallbac } } /** * Update the bounds used to save the re-entry size and snap fraction when exiting PIP. */ public void updateReentryBounds(Rect bounds) { final Rect reentryBounds = mTouchHandler.getUserResizeBounds(); float snapFraction = mPipBoundsHandler.getSnapFraction(bounds); mPipBoundsHandler.applySnapFraction(reentryBounds, snapFraction); mReentryBounds.set(reentryBounds); } @Override public void onPipTransitionFinished(ComponentName activity, int direction) { onPipTransitionFinishedOrCanceled(direction); Loading