summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Miranda <jonmiranda@google.com>2017-02-21 09:06:51 -0800
committerJon Miranda <jonmiranda@google.com>2017-02-21 09:07:00 -0800
commit48dfd26195603bf863be40f1d40922b8077fe5ef (patch)
tree3639a6fbf966d2f57708af23b84b311a1bbd5a1e
parent872943ed69fdb414b00517df246106bed2c27891 (diff)
downloadandroid_packages_apps_Trebuchet-48dfd26195603bf863be40f1d40922b8077fe5ef.tar.gz
android_packages_apps_Trebuchet-48dfd26195603bf863be40f1d40922b8077fe5ef.tar.bz2
android_packages_apps_Trebuchet-48dfd26195603bf863be40f1d40922b8077fe5ef.zip
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
-rw-r--r--src/com/android/launcher3/folder/Folder.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/com/android/launcher3/folder/Folder.java b/src/com/android/launcher3/folder/Folder.java
index 3d28f2291..4ad13d0ce 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() *