Merge "Fix casts to Math.round() in real landscape" into tm-qpr-dev am: 0bc70442d6
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/20179629 Change-Id: Iad37a502a5e1b14109b0bbb742a30a5323237eeb Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -618,15 +618,17 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
|
||||
if (desiredStagePosition == SplitConfigurationOptions.STAGE_POSITION_TOP_OR_LEFT) {
|
||||
if (isLandscape) {
|
||||
outRect.right = outRect.left + (int) (outRect.width() * topLeftTaskPercent);
|
||||
outRect.right = outRect.left + Math.round(outRect.width() * topLeftTaskPercent);
|
||||
} else {
|
||||
outRect.bottom = outRect.top + (int) (outRect.height() * topLeftTaskPercent);
|
||||
outRect.bottom = outRect.top + Math.round(outRect.height() * topLeftTaskPercent);
|
||||
}
|
||||
} else {
|
||||
if (isLandscape) {
|
||||
outRect.left += (int) (outRect.width() * (topLeftTaskPercent + dividerBarPercent));
|
||||
outRect.left += Math.round(outRect.width()
|
||||
* (topLeftTaskPercent + dividerBarPercent));
|
||||
} else {
|
||||
outRect.top += (int) (outRect.height() * (topLeftTaskPercent + dividerBarPercent));
|
||||
outRect.top += Math.round(outRect.height()
|
||||
* (topLeftTaskPercent + dividerBarPercent));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -639,7 +641,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
int totalThumbnailHeight = parentHeight - spaceAboveSnapshot;
|
||||
int dividerBar = Math.round(splitBoundsConfig.appsStackedVertically
|
||||
? splitBoundsConfig.dividerHeightPercent * totalThumbnailHeight
|
||||
: splitBoundsConfig.dividerWidthPercent * totalThumbnailHeight);
|
||||
: splitBoundsConfig.dividerWidthPercent * parentWidth);
|
||||
int primarySnapshotHeight;
|
||||
int primarySnapshotWidth;
|
||||
int secondarySnapshotHeight;
|
||||
@@ -648,7 +650,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
splitBoundsConfig.topTaskPercent : splitBoundsConfig.leftTaskPercent;
|
||||
if (dp.isLandscape) {
|
||||
primarySnapshotHeight = totalThumbnailHeight;
|
||||
primarySnapshotWidth = (int) (parentWidth * taskPercent);
|
||||
primarySnapshotWidth = Math.round(parentWidth * taskPercent);
|
||||
|
||||
secondarySnapshotHeight = totalThumbnailHeight;
|
||||
secondarySnapshotWidth = parentWidth - primarySnapshotWidth - dividerBar;
|
||||
@@ -663,7 +665,7 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
|
||||
secondarySnapshot.setTranslationY(spaceAboveSnapshot);
|
||||
} else {
|
||||
primarySnapshotWidth = parentWidth;
|
||||
primarySnapshotHeight = (int) (totalThumbnailHeight * taskPercent);
|
||||
primarySnapshotHeight = Math.round(totalThumbnailHeight * taskPercent);
|
||||
|
||||
secondarySnapshotWidth = parentWidth;
|
||||
secondarySnapshotHeight = totalThumbnailHeight - primarySnapshotHeight - dividerBar;
|
||||
|
||||
Reference in New Issue
Block a user