Merge "Fix issue with split thumbnails overflowing during rotation" into tm-dev

This commit is contained in:
Jeremy Sim
2022-03-22 00:17:43 +00:00
committed by Android (Google) Code Review
2 changed files with 20 additions and 12 deletions
@@ -495,19 +495,24 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
public void setSplitTaskSwipeRect(DeviceProfile dp, Rect outRect,
StagedSplitBounds splitInfo, int desiredStagePosition) {
boolean isLandscape = dp.isLandscape;
float topLeftTaskPercent = splitInfo.appsStackedVertically
? splitInfo.topTaskPercent
: splitInfo.leftTaskPercent;
float dividerBarPercent = splitInfo.appsStackedVertically
? splitInfo.dividerHeightPercent
: splitInfo.dividerWidthPercent;
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
if (isLandscape) {
outRect.right = outRect.left + (int) (outRect.width() * splitInfo.leftTaskPercent);
outRect.right = outRect.left + (int) (outRect.width() * topLeftTaskPercent);
} else {
outRect.bottom = outRect.top + (int) (outRect.height() * splitInfo.topTaskPercent);
outRect.bottom = outRect.top + (int) (outRect.height() * topLeftTaskPercent);
}
} else {
if (isLandscape) {
outRect.left += (int) (outRect.width() *
(splitInfo.leftTaskPercent + splitInfo.dividerWidthPercent));
outRect.left += (int) (outRect.width() * (topLeftTaskPercent + dividerBarPercent));
} else {
outRect.top += (int) (outRect.height() *
(splitInfo.topTaskPercent + splitInfo.dividerHeightPercent));
outRect.top += (int) (outRect.height() * (topLeftTaskPercent + dividerBarPercent));
}
}
}