Merge "Use getMeasuredWidth instead of getWidth in setSplitIconParams" into sc-v2-dev am: ad890ac5af

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/apps/Launcher3/+/16388226

Change-Id: Ib70eeb70bc556885ba35912db78cf0f9518528a3
This commit is contained in:
TreeHugger Robot authored and Automerger Merge Worker committed 2021-12-03 20:46:37 +00:00
commit 4e36642c01
2 files changed
+5 -4

No files matched your search

@@ -249,7 +249,7 @@ public class GroupedTaskView extends TaskView {
boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL; boolean isRtl = getLayoutDirection() == LAYOUT_DIRECTION_RTL;
getPagedOrientationHandler().setSplitIconParams(mIconView, mIconView2, getPagedOrientationHandler().setSplitIconParams(mIconView, mIconView2,
taskIconHeight, mSnapshotView.getWidth(), mSnapshotView.getHeight(), taskIconHeight, mSnapshotView.getMeasuredWidth(), mSnapshotView.getMeasuredHeight(),
isRtl, deviceProfile, mSplitBoundsConfig); isRtl, deviceProfile, mSplitBoundsConfig);
} }
@@ -541,17 +541,18 @@ public class PortraitPagedViewHandler implements PagedOrientationHandler {
if (deviceProfile.isLandscape) { if (deviceProfile.isLandscape) {
primaryIconParams.gravity = TOP | START; primaryIconParams.gravity = TOP | START;
primaryIconView.setTranslationX(primarySnapshotWidth - primaryIconView.getWidth()); primaryIconView.setTranslationX(
primarySnapshotWidth - primaryIconView.getMeasuredWidth());
primaryIconView.setTranslationY(0); primaryIconView.setTranslationY(0);
secondaryIconParams.gravity = TOP | START; secondaryIconParams.gravity = TOP | START;
secondaryIconView.setTranslationX(primarySnapshotWidth + dividerBar); secondaryIconView.setTranslationX(primarySnapshotWidth + dividerBar);
} else { } else {
primaryIconParams.gravity = TOP | CENTER_HORIZONTAL; primaryIconParams.gravity = TOP | CENTER_HORIZONTAL;
primaryIconView.setTranslationX(-(primaryIconView.getWidth()) / 2f); primaryIconView.setTranslationX(-(primaryIconView.getMeasuredWidth()) / 2f);
primaryIconView.setTranslationY(0); primaryIconView.setTranslationY(0);
secondaryIconParams.gravity = TOP | CENTER_HORIZONTAL; secondaryIconParams.gravity = TOP | CENTER_HORIZONTAL;
secondaryIconView.setTranslationX(secondaryIconView.getWidth() / 2f); secondaryIconView.setTranslationX(secondaryIconView.getMeasuredWidth() / 2f);
} }
secondaryIconView.setTranslationY(0); secondaryIconView.setTranslationY(0);
primaryIconView.setLayoutParams(primaryIconParams); primaryIconView.setLayoutParams(primaryIconParams);