From 87fad7b9841c4dbc77c20b4e3c0a414d103aba55 Mon Sep 17 00:00:00 2001 From: Jeremy Sim Date: Wed, 23 Feb 2022 18:35:47 -0800 Subject: [PATCH] Fix small positioning bug with DWB banner in landscape The DWB banner is now positioned correctly when the task thumbnail is set as a secondary split view. Fixes: 220637396 Test: Manual testing on local Pixel 6 Change-Id: I3bcb0eb09d2a607b2891bc9f63f3a0b03668f48e --- .../launcher3/touch/PortraitPagedViewHandler.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index 0d92e2542a..7babdc5816 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -352,8 +352,14 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { // Set translations if (deviceProfile.isLandscape) { if (desiredTaskId == splitBounds.rightBottomTaskId) { - translationX = ((taskViewWidth * splitBounds.leftTaskPercent) - + (taskViewWidth * splitBounds.dividerWidthPercent)); + float leftTopTaskPercent = splitBounds.appsStackedVertically + ? splitBounds.topTaskPercent + : splitBounds.leftTaskPercent; + float dividerThicknessPercent = splitBounds.appsStackedVertically + ? splitBounds.dividerHeightPercent + : splitBounds.dividerWidthPercent; + translationX = ((taskViewWidth * leftTopTaskPercent) + + (taskViewWidth * dividerThicknessPercent)); } } else { if (desiredTaskId == splitBounds.leftTopTaskId) {