From 57fc157e25669192aa22d82e240f05f74a516bce Mon Sep 17 00:00:00 2001 From: Sebastian Franco Date: Tue, 25 Apr 2023 16:33:51 -0700 Subject: [PATCH] Set start time for open folder animation before starting the animation The start time of the animation was being set after the animation started causing the animation to jump to an start time after it already started wich was very obvious when setting the animation speed to 0. To test set the aimation speed to zero like so: adb shell settings put global animator_duration_scale 0 adb shell settings put global transition_animation_scale 0 adb shell settings put global window_animation_scale 0 Fix: 279662507 Test: explained above Test: FolderScreenShootTest will test it in the future Change-Id: Id6e10720ffdf64e062e533cd3187f386f57ae906 --- src/com/android/launcher3/folder/Folder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index c9fe745ea1..3c31b7a7c9 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -733,10 +733,11 @@ 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())); + startAnimation(anim); // Make sure the folder picks up the last drag move even if the finger doesn't move. if (mDragController.isDragging()) {