Merge "Retain current position and expand state on next video" into rvc-dev am: 7d4bad92af am: b7a1bd5578
Change-Id: Idefa7e0b8b5e50d0592a01f66b2a3b74ae5f4695
This commit is contained in:
@@ -250,10 +250,19 @@ public class PipBoundsHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {@link Rect} of the destination PiP window bounds.
|
* See {@link #getDestinationBounds(ComponentName, float, Rect, Size, boolean)}
|
||||||
*/
|
*/
|
||||||
Rect getDestinationBounds(ComponentName componentName, float aspectRatio, Rect bounds,
|
Rect getDestinationBounds(ComponentName componentName, float aspectRatio, Rect bounds,
|
||||||
Size minimalSize) {
|
Size minimalSize) {
|
||||||
|
return getDestinationBounds(componentName, aspectRatio, bounds, minimalSize,
|
||||||
|
false /* useCurrentMinEdgeSize */);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return {@link Rect} of the destination PiP window bounds.
|
||||||
|
*/
|
||||||
|
Rect getDestinationBounds(ComponentName componentName, float aspectRatio, Rect bounds,
|
||||||
|
Size minimalSize, boolean useCurrentMinEdgeSize) {
|
||||||
if (!componentName.equals(mLastPipComponentName)) {
|
if (!componentName.equals(mLastPipComponentName)) {
|
||||||
onResetReentryBoundsUnchecked();
|
onResetReentryBoundsUnchecked();
|
||||||
mLastPipComponentName = componentName;
|
mLastPipComponentName = componentName;
|
||||||
@@ -269,8 +278,7 @@ public class PipBoundsHandler {
|
|||||||
destinationBounds = new Rect(bounds);
|
destinationBounds = new Rect(bounds);
|
||||||
}
|
}
|
||||||
if (isValidPictureInPictureAspectRatio(aspectRatio)) {
|
if (isValidPictureInPictureAspectRatio(aspectRatio)) {
|
||||||
transformBoundsToAspectRatio(destinationBounds, aspectRatio,
|
transformBoundsToAspectRatio(destinationBounds, aspectRatio, useCurrentMinEdgeSize);
|
||||||
false /* useCurrentMinEdgeSize */);
|
|
||||||
}
|
}
|
||||||
mAspectRatio = aspectRatio;
|
mAspectRatio = aspectRatio;
|
||||||
return destinationBounds;
|
return destinationBounds;
|
||||||
|
|||||||
@@ -459,7 +459,8 @@ public class PipTaskOrganizer extends TaskOrganizer implements
|
|||||||
}
|
}
|
||||||
final Rect destinationBounds = mPipBoundsHandler.getDestinationBounds(
|
final Rect destinationBounds = mPipBoundsHandler.getDestinationBounds(
|
||||||
info.topActivity, getAspectRatioOrDefault(newParams),
|
info.topActivity, getAspectRatioOrDefault(newParams),
|
||||||
null /* bounds */, getMinimalSize(info.topActivityInfo));
|
mLastReportedBounds, getMinimalSize(info.topActivityInfo),
|
||||||
|
true /* userCurrentMinEdgeSize */);
|
||||||
Objects.requireNonNull(destinationBounds, "Missing destination bounds");
|
Objects.requireNonNull(destinationBounds, "Missing destination bounds");
|
||||||
scheduleAnimateResizePip(destinationBounds, mEnterExitAnimationDuration,
|
scheduleAnimateResizePip(destinationBounds, mEnterExitAnimationDuration,
|
||||||
null /* updateBoundsCallback */);
|
null /* updateBoundsCallback */);
|
||||||
|
|||||||
Reference in New Issue
Block a user