Loading packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java +17 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class PreviewPositionHelper { private boolean mIsOrientationChanged; private SplitBounds mSplitBounds; private int mDesiredStagePosition; private boolean mTaskbarInApp; public Matrix getMatrix() { return mMatrix; Loading @@ -57,6 +58,10 @@ public class PreviewPositionHelper { mDesiredStagePosition = desiredStagePosition; } public void setTaskbarInApp(boolean taskbarInApp) { mTaskbarInApp = taskbarInApp; } /** * Updates the matrix based on the provided parameters */ Loading @@ -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; 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 Loading Loading
packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java +17 −2 Original line number Diff line number Diff line Loading @@ -39,6 +39,7 @@ public class PreviewPositionHelper { private boolean mIsOrientationChanged; private SplitBounds mSplitBounds; private int mDesiredStagePosition; private boolean mTaskbarInApp; public Matrix getMatrix() { return mMatrix; Loading @@ -57,6 +58,10 @@ public class PreviewPositionHelper { mDesiredStagePosition = desiredStagePosition; } public void setTaskbarInApp(boolean taskbarInApp) { mTaskbarInApp = taskbarInApp; } /** * Updates the matrix based on the provided parameters */ Loading @@ -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; 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 Loading