Merge "Allow finish resize transaction to be overriden" into rvc-dev am: 62a69b9632
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11838962 Change-Id: I95a4c8d06f00d4ca0d13c297b1f43ca812f82836
This commit is contained in:
@@ -744,9 +744,9 @@ public class PipTaskOrganizer extends TaskOrganizer implements
|
|||||||
// on the task to ensure that the task "matches" the parent's bounds.
|
// on the task to ensure that the task "matches" the parent's bounds.
|
||||||
taskBounds = (direction == TRANSITION_DIRECTION_TO_FULLSCREEN)
|
taskBounds = (direction == TRANSITION_DIRECTION_TO_FULLSCREEN)
|
||||||
? null : destinationBounds;
|
? null : destinationBounds;
|
||||||
// As for the final windowing mode, simply reset it to undefined and reset the activity
|
// Reset the final windowing mode.
|
||||||
// mode set prior to the animation running
|
wct.setWindowingMode(mToken, getOutPipWindowingMode());
|
||||||
wct.setWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
|
// Simply reset the activity mode set prior to the animation running.
|
||||||
wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
|
wct.setActivityWindowingMode(mToken, WINDOWING_MODE_UNDEFINED);
|
||||||
if (mSplitDivider != null && direction == TRANSITION_DIRECTION_TO_SPLIT_SCREEN) {
|
if (mSplitDivider != null && direction == TRANSITION_DIRECTION_TO_SPLIT_SCREEN) {
|
||||||
wct.reparent(mToken, mSplitDivider.getSecondaryRoot(), true /* onTop */);
|
wct.reparent(mToken, mSplitDivider.getSecondaryRoot(), true /* onTop */);
|
||||||
@@ -758,9 +758,30 @@ public class PipTaskOrganizer extends TaskOrganizer implements
|
|||||||
|
|
||||||
wct.setBounds(mToken, taskBounds);
|
wct.setBounds(mToken, taskBounds);
|
||||||
wct.setBoundsChangeTransaction(mToken, tx);
|
wct.setBoundsChangeTransaction(mToken, tx);
|
||||||
|
applyFinishBoundsResize(wct, direction);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applies the window container transaction to finish a bounds resize.
|
||||||
|
*
|
||||||
|
* Called by {@link #finishResize(SurfaceControl.Transaction, Rect, int, int)}} once it has
|
||||||
|
* finished preparing the transaction. It allows subclasses to modify the transaction before
|
||||||
|
* applying it.
|
||||||
|
*/
|
||||||
|
public void applyFinishBoundsResize(@NonNull WindowContainerTransaction wct,
|
||||||
|
@PipAnimationController.TransitionDirection int direction) {
|
||||||
WindowOrganizer.applyTransaction(wct);
|
WindowOrganizer.applyTransaction(wct);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The windowing mode to restore to when resizing out of PIP direction. Defaults to undefined
|
||||||
|
* and can be overridden to restore to an alternate windowing mode.
|
||||||
|
*/
|
||||||
|
public int getOutPipWindowingMode() {
|
||||||
|
// By default, simply reset the windowing mode to undefined.
|
||||||
|
return WINDOWING_MODE_UNDEFINED;
|
||||||
|
}
|
||||||
|
|
||||||
private void animateResizePip(Rect currentBounds, Rect destinationBounds,
|
private void animateResizePip(Rect currentBounds, Rect destinationBounds,
|
||||||
@PipAnimationController.TransitionDirection int direction, int durationMs) {
|
@PipAnimationController.TransitionDirection int direction, int durationMs) {
|
||||||
if (Looper.myLooper() != mUpdateHandler.getLooper()) {
|
if (Looper.myLooper() != mUpdateHandler.getLooper()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user