From c702c4f542a3e7d75fdab7af53578efbb8fc0114 Mon Sep 17 00:00:00 2001 From: Vinit Nayak Date: Fri, 11 Nov 2022 18:32:34 -0800 Subject: [PATCH] Incremental update to portrait split gesture animation * More closely trying to match PreviewPositionHelper to the calculations in PortraitPagedViewHandler. * It's correct for unstashed, it's improved for stashed, but there's something still slightly wrong. One thought is to match the calculations line for line, similat to setSplitTaskSwipeRect(), using the screenHeightPx instead of canvasHeight to determine the scale (doesn't work by itself), but it's slightly closer, though we'd also need to make changes to measureGroupedTaskViewThumbnailBounds() accordingly Bug: 219411750 Test: Visually inspected Change-Id: I518a884552accfd1c56c14cf98fd0fdcd00e817a --- .../shared/recents/utilities/PreviewPositionHelper.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 f45887cf76307..f6c75a2d27528 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 @@ -82,7 +82,8 @@ public class PreviewPositionHelper { taskPercent = mDesiredStagePosition != STAGE_POSITION_TOP_OR_LEFT ? mSplitBounds.topTaskPercent : (1 - (mSplitBounds.topTaskPercent + mSplitBounds.dividerHeightPercent)); - fullscreenTaskHeight = screenHeightPx * taskPercent; + // Scale portrait height to that of (actual screen - taskbar inset) + fullscreenTaskHeight = (screenHeightPx - taskbarSize) * taskPercent; canvasScreenRatio = canvasHeight / fullscreenTaskHeight; } else { // For landscape, scale the width