Fix shelf tracking distance for landscape app over portrait launcher
Bug: 149934536
Change-Id: I14fa62fa9f51356613f4a3827446b00af774dbf5
diff --git a/quickstep/src/com/android/quickstep/util/LayoutUtils.java b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
index ae19d73..4bd332a 100644
--- a/quickstep/src/com/android/quickstep/util/LayoutUtils.java
+++ b/quickstep/src/com/android/quickstep/util/LayoutUtils.java
@@ -49,7 +49,9 @@
Rect taskSize = new Rect();
LauncherActivityInterface.INSTANCE.calculateTaskSize(context, dp, taskSize,
orientationHandler);
- return (dp.heightPx - taskSize.height()) / 2;
+ return (orientationHandler.getSecondaryValue(dp.widthPx, dp.heightPx)
+ - orientationHandler.getSecondaryValue(taskSize.width(), taskSize.height()))
+ / 2;
}
int shelfHeight = dp.hotseatBarSizePx + dp.getInsets().bottom;
int spaceBetweenShelfAndRecents = (int) context.getResources().getDimension(