From 48dfd26195603bf863be40f1d40922b8077fe5ef Mon Sep 17 00:00:00 2001 From: Jon Miranda Date: Tue, 21 Feb 2017 09:06:51 -0800 Subject: [PATCH] Fix folder icon animation where it animates downwards on 1st run. The first time FolderIcon#growAndFadeOut is called, the folder icon pivot x/y is not set. By moving the call after centerAboutIcon (which sets the pivot point), we get the expected result of the animation growing upward. Bug: 35126799 Change-Id: I22fccb6b23550f823eb7b4485b9584022b810323 --- src/com/android/launcher3/folder/Folder.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java index 3d28f2291a..4ad13d0ceb 100644 --- a/src/com/android/launcher3/folder/Folder.java +++ b/src/com/android/launcher3/folder/Folder.java @@ -535,7 +535,6 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC } mIsOpen = true; - mFolderIcon.growAndFadeOut(); mContent.completePendingPageChanges(); if (!mDragInProgress) { @@ -552,6 +551,8 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC prepareReveal(); centerAboutIcon(); + mFolderIcon.growAndFadeOut(); + AnimatorSet anim = LauncherAnimUtils.createAnimatorSet(); int width = getPaddingLeft() + getPaddingRight() + mContent.getDesiredWidth(); int height = getFolderHeight(); @@ -1088,6 +1089,7 @@ public class Folder extends AbstractFloatingView implements DragSource, View.OnC int folderPivotY = height / 2 + (centeredTop - top); setPivotX(folderPivotX); setPivotY(folderPivotY); + mFolderIconPivotX = (int) (mFolderIcon.getMeasuredWidth() * (1.0f * folderPivotX / width)); mFolderIconPivotY = (int) (mFolderIcon.getMeasuredHeight() *