From 0369cd54705e53b8af9afb8fd47d1732464c1313 Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Fri, 19 Mar 2021 12:07:19 -0400 Subject: [PATCH] Folder updates. - 3 item folder preview has the first item on top of the other 2 - Skip first frame of the folder open animation as there is no visual change in that first frame. Bug: 175329686 Test: visual Change-Id: Ida9a55ee5093c49f230cdf22d7943b2a6a7ed42d --- .../android/launcher3/folder/ClippedFolderIconLayoutRule.java | 2 +- src/com/android/launcher3/folder/Folder.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java index 5954efa95f..c67efefa5d 100644 --- a/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java +++ b/src/com/android/launcher3/folder/ClippedFolderIconLayoutRule.java @@ -97,7 +97,7 @@ public class ClippedFolderIconLayoutRule { double thetaShift = 0; if (curNumItems == 3) { - thetaShift = Math.PI / 6; + thetaShift = Math.PI / 2; } else if (curNumItems == 4) { thetaShift = Math.PI / 4; } diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index bcb3a54ef3..ec7155c1b1 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -26,6 +26,7 @@ import static com.android.launcher3.config.FeatureFlags.ALWAYS_USE_HARDWARE_OPTI import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_CONVERTED_TO_ICON; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_FOLDER_LABEL_UPDATED; import static com.android.launcher3.logging.StatsLogManager.LauncherEvent.LAUNCHER_ITEM_DROP_COMPLETED; +import static com.android.launcher3.util.DisplayController.getSingleFrameMs; import android.animation.Animator; import android.animation.AnimatorListenerAdapter; @@ -695,6 +696,9 @@ public class Folder extends AbstractFloatingView implements ClipPathView, DragSo mPageIndicator.stopAllAnimations(); startAnimation(anim); + // Because t=0 has the folder match the folder icon, we can skip the + // first frame and have the same movement one frame earlier. + anim.setCurrentPlayTime(Math.min(getSingleFrameMs(getContext()), anim.getTotalDuration())); // Make sure the folder picks up the last drag move even if the finger doesn't move. if (mDragController.isDragging()) {