Slight polish for split screen gesture animation

* Divider bar dimensions manually calculated since
the leash that is provided has bounds larger than
the space that is visually shown between the two split
apps

Bug: 181704764
Test: Swipe up on large and normal screen,
w/ and w/o home rotation enabled

Change-Id: I1fde053151d47c6ce3e11f16f8ae4a153d273871
This commit is contained in:
Vinit Nayak
2021-09-07 16:50:21 -07:00
parent 9d4966d0ca
commit d1a70eeb75
4 changed files with 31 additions and 27 deletions

View File

@@ -388,11 +388,12 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
float diff;
float horizontalDividerDiff = splitInfo.visualDividerBounds.width() / 2f;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
diff = outRect.height() * (1f - splitInfo.leftTaskPercent);
diff = outRect.height() * (1f - splitInfo.leftTaskPercent) + horizontalDividerDiff;
outRect.bottom -= diff;
} else {
diff = outRect.height() * splitInfo.leftTaskPercent;
diff = outRect.height() * splitInfo.leftTaskPercent + horizontalDividerDiff;
outRect.top += diff;
}
}
@@ -402,7 +403,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
SplitConfigurationOptions.StagedSplitBounds splitInfo, int desiredStagePosition) {
if (desiredStagePosition == STAGE_POSITION_BOTTOM_OR_RIGHT) {
// The preview set is for the bottom/right, inset by top/left task
splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.dividerBounds.width() / 2;
splitOffset.x = splitInfo.leftTopBounds.width() + splitInfo.visualDividerBounds.width();
}
}
@@ -413,7 +414,7 @@ public class LandscapePagedViewHandler implements PagedOrientationHandler {
int spaceAboveSnapshot = dp.overviewTaskThumbnailTopMarginPx;
int totalThumbnailHeight = taskParent.getHeight() - spaceAboveSnapshot;
int totalThumbnailWidth = taskParent.getWidth();
int dividerBar = splitBoundsConfig.dividerBounds.width() / 2;
int dividerBar = splitBoundsConfig.visualDividerBounds.width();
ViewGroup.LayoutParams primaryLp = mSnapshotView.getLayoutParams();
ViewGroup.LayoutParams secondaryLp = mSnapshotView2.getLayoutParams();