diff options
| author | 2022-12-01 19:47:32 +0000 | |
|---|---|---|
| committer | 2022-12-01 19:47:32 +0000 | |
| commit | a1a624a3bb582b8d19d8f48ce1c745036544af8c (patch) | |
| tree | 5955a47cbb7795045c71ed03e3ffeda37dd53fae | |
| parent | e6c2a39fae9b5bd6665c548166136258a9be926d (diff) | |
| parent | d424d7a00b9724edcc6e03f5b34d64afea44bfc2 (diff) | |
Merge "Ignore cropping taskbar for top app in split portrait" into tm-qpr-dev am: d424d7a00b
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/20475709
Change-Id: Id82d9144e68620ed5cb048913a4690fa4fee4bf6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
| -rw-r--r-- | packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java index f6c75a2d2752..c9ea79432360 100644 --- a/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java +++ b/packages/SystemUI/shared/src/com/android/systemui/shared/recents/utilities/PreviewPositionHelper.java @@ -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 |