From 9b001f527eee13ebd93f0653596f73babf5d6fe6 Mon Sep 17 00:00:00 2001 From: Charlie Anderson Date: Tue, 4 Mar 2025 11:15:29 -0500 Subject: [PATCH] Make sure folder positioning is behind flag Bug: 392610664 Flag: com.android.launcher3.enable_launcher_icon_shapes Test: manually verify with flag on/off Change-Id: I3564a0fee5bf0948994c056fd22f4e2c3c91f0ee --- .../folder/ClippedFolderIconLayoutRule.java | 28 +++++++++++-------- 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java index 36dad89e9a..fedc1181c2 100644 --- a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java +++ b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java @@ -53,18 +53,22 @@ public class ClippedFolderIconLayoutRule { } else if (index >= MAX_NUM_ITEMS_IN_PREVIEW) { // Items beyond those displayed in the preview are animated to the center mTmpPoint[0] = mTmpPoint[1] = mAvailableSpace / 2 - (mIconSize * totalScale) / 2; - } else if (index == 0) { - // top left - getGridPosition(0, 0, mTmpPoint); - } else if (index == 1) { - // top right - getGridPosition(0, 1, mTmpPoint); - } else if (index == 2) { - // bottom left - getGridPosition(1, 0, mTmpPoint); - } else if (index == 3) { - // bottom right - getGridPosition(1, 1, mTmpPoint); + } else if (Flags.enableLauncherIconShapes()) { + if (index == 0) { + // top left + getGridPosition(0, 0, mTmpPoint); + } else if (index == 1) { + // top right + getGridPosition(0, 1, mTmpPoint); + } else if (index == 2) { + // bottom left + getGridPosition(1, 0, mTmpPoint); + } else if (index == 3) { + // bottom right + getGridPosition(1, 1, mTmpPoint); + } + } else { + getPosition(index, curNumItems, mTmpPoint); } transX = mTmpPoint[0];