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
This commit is contained in:
Vinit Nayak
2022-11-11 18:32:34 -08:00
parent c6fcd76d6a
commit c702c4f542

View File

@@ -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