diff options
| author | 2020-09-22 01:16:47 +0000 | |
|---|---|---|
| committer | 2020-09-22 01:16:47 +0000 | |
| commit | dfbd288cdbdb6bf054c7cc7cb2db583dc92eb050 (patch) | |
| tree | bd2da08bdc3343ce975c88cd9d13be28498a1a49 | |
| parent | 108bfdc042c9da69b44da8e4d2ed2ba51638813c (diff) | |
| parent | 207a1f1bf4f896a5d03df480d2c5ccfe9edcd9dc (diff) | |
Merge "Reset Task surface to no-crop after pip expand when fullscreen"
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java b/packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java index 419d8d590124..52ce7fe210ec 100644 --- a/packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java +++ b/packages/SystemUI/src/com/android/systemui/pip/PipAnimationController.java @@ -219,7 +219,7 @@ public class PipAnimationController { public void onAnimationEnd(Animator animation) { mCurrentValue = mEndValue; final SurfaceControl.Transaction tx = newSurfaceControlTransaction(); - onEndTransaction(mLeash, tx); + onEndTransaction(mLeash, tx, mTransitionDirection); if (mPipAnimationCallback != null) { mPipAnimationCallback.onPipAnimationEnd(tx, this); } @@ -319,7 +319,8 @@ public class PipAnimationController { void onStartTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) {} - void onEndTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) {} + void onEndTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, + @TransitionDirection int transitionDirection) {} abstract void applySurfaceControlTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, float fraction); @@ -426,13 +427,20 @@ public class PipAnimationController { } @Override - void onEndTransaction(SurfaceControl leash, SurfaceControl.Transaction tx) { + void onEndTransaction(SurfaceControl leash, SurfaceControl.Transaction tx, + int transitionDirection) { // NOTE: intentionally does not apply the transaction here. // this end transaction should get executed synchronously with the final // WindowContainerTransaction in task organizer - getSurfaceTransactionHelper() - .resetScale(tx, leash, getDestinationBounds()) - .crop(tx, leash, getDestinationBounds()); + final Rect destBounds = getDestinationBounds(); + getSurfaceTransactionHelper().resetScale(tx, leash, destBounds); + if (transitionDirection == TRANSITION_DIRECTION_LEAVE_PIP) { + // Leaving to fullscreen, reset crop to null. + tx.setPosition(leash, destBounds.left, destBounds.top); + tx.setWindowCrop(leash, 0, 0); + } else { + getSurfaceTransactionHelper().crop(tx, leash, destBounds); + } } @Override |