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
This commit is contained in:
Jon Miranda
2017-02-21 09:06:51 -08:00
parent 872943ed69
commit 48dfd26195
+3 -1
View File
@@ -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() *