From 4bdf8c1754cddf1b10bc47e17f329a2f71455f0f Mon Sep 17 00:00:00 2001 From: Alex Chau Date: Fri, 3 Dec 2021 18:28:38 +0000 Subject: [PATCH] Use getMeasuredWidth instead of getWidth in setSplitIconParams Fix: 208647202 Test: Enter overview with app pairs, rotate and rotate back, check the task icon Change-Id: I14914258a2508cf3f399312f4c88574b27a5e9fa --- .../src/com/android/quickstep/views/GroupedTaskView.java | 2 +- .../android/launcher3/touch/PortraitPagedViewHandler.java | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java index 9311261624..b215ef1f54 100644 --- a/quickstep/src/com/android/quickstep/views/GroupedTaskView.java +++ b/quickstep/src/com/android/quickstep/views/GroupedTaskView.java @@ -249,7 +249,7 @@ public class GroupedTaskView extends TaskView { boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; getPagedOrientationHandler().setSplitIconParams(mIconView, mIconView2, - taskIconHeight, mSnapshotView.getWidth(), mSnapshotView.getHeight(), + taskIconHeight, mSnapshotView.getMeasuredWidth(), mSnapshotView.getMeasuredHeight(), isRtl, deviceProfile, mSplitBoundsConfig); } diff --git a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java index b9f1b66a68..cb1ba7d402 100644 --- a/src/com/android/launcher3/touch/PortraitPagedViewHandler.java +++ b/src/com/android/launcher3/touch/PortraitPagedViewHandler.java @@ -541,17 +541,18 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler { if (deviceProfile.isLandscape) { primaryIconParams.gravity = TOP | START; - primaryIconView.setTranslationX(primarySnapshotWidth - primaryIconView.getWidth()); + primaryIconView.setTranslationX( + primarySnapshotWidth - primaryIconView.getMeasuredWidth()); primaryIconView.setTranslationY(0); secondaryIconParams.gravity = TOP | START; secondaryIconView.setTranslationX(primarySnapshotWidth + dividerBar); } else { primaryIconParams.gravity = TOP | CENTER_HORIZONTAL; - primaryIconView.setTranslationX(-(primaryIconView.getWidth()) / 2f); + primaryIconView.setTranslationX(-(primaryIconView.getMeasuredWidth()) / 2f); primaryIconView.setTranslationY(0); secondaryIconParams.gravity = TOP | CENTER_HORIZONTAL; - secondaryIconView.setTranslationX(secondaryIconView.getWidth() / 2f); + secondaryIconView.setTranslationX(secondaryIconView.getMeasuredWidth() / 2f); } secondaryIconView.setTranslationY(0); primaryIconView.setLayoutParams(primaryIconParams);