Ignore cropping taskbar for top app in split portrait

* See ag/20470413

Bug: 219411750
Test: Swipe up w/ stashed taskbar in portrait.
Thumbnail cutout doesn't appear when dragging to
fullscreen

Change-Id: I5f8279a3d7a1cfe14c6fafaa15307d258a6f2f10
This commit is contained in:
Vinit Nayak
2022-11-14 21:14:33 -08:00
parent dcb2710560
commit 54ede0bfca

View File

@@ -39,6 +39,7 @@ public class PreviewPositionHelper {
private boolean mIsOrientationChanged;
private SplitBounds mSplitBounds;
private int mDesiredStagePosition;
private boolean mTaskbarInApp;
public Matrix getMatrix() {
return mMatrix;
@@ -57,6 +58,10 @@ public class PreviewPositionHelper {
mDesiredStagePosition = desiredStagePosition;
}
public void setTaskbarInApp(boolean taskbarInApp) {
mTaskbarInApp = taskbarInApp;
}
/**
* Updates the matrix based on the provided parameters
*/
@@ -83,8 +88,18 @@ public class PreviewPositionHelper {
? mSplitBounds.topTaskPercent
: (1 - (mSplitBounds.topTaskPercent + mSplitBounds.dividerHeightPercent));
// Scale portrait height to that of (actual screen - taskbar inset)
fullscreenTaskHeight = (screenHeightPx - taskbarSize) * taskPercent;
canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
fullscreenTaskHeight = (screenHeightPx) * taskPercent;
if (mTaskbarInApp) {
canvasScreenRatio = canvasHeight / fullscreenTaskHeight;
} else {
if (mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT) {
// Top app isn't cropped at all by taskbar
canvasScreenRatio = 0;
} else {
// Same as fullscreen ratio
canvasScreenRatio = (float) canvasWidth / screenWidthPx;
}
}
} else {
// For landscape, scale the width
taskPercent = mDesiredStagePosition == STAGE_POSITION_TOP_OR_LEFT