diff options
author | Jon Miranda <jonmiranda@google.com> | 2017-06-26 11:24:33 -0700 |
---|---|---|
committer | Jon Miranda <jonmiranda@google.com> | 2017-06-26 11:31:33 -0700 |
commit | c7aa37d6969f22ef0ff3a071949601a36f40465d (patch) | |
tree | 6bd716aa56621320deed7d7e47b8bd10dc8bfb3e /src | |
parent | cb73920b231ab4e26dcf3500e65daeedda88c912 (diff) | |
download | android_packages_apps_Trebuchet-c7aa37d6969f22ef0ff3a071949601a36f40465d.tar.gz android_packages_apps_Trebuchet-c7aa37d6969f22ef0ff3a071949601a36f40465d.tar.bz2 android_packages_apps_Trebuchet-c7aa37d6969f22ef0ff3a071949601a36f40465d.zip |
Animate Folder elevation halfway thru transition.
The current implementation had the Folder elevation animate in
after the Folder transition was done completing. To make it appear
more smooth, we animate the Folder elevation halfway thru the
transition.
We will keep the separate FolderIcon shadow fade-in animation on
the closing transition otherwise the shadow will be apparent in the
"preview."
Bug: 62787582
Bug: 35064148
Change-Id: Ifd3d84214b0600b6651005c8e65d90b0d8ade422
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/launcher3/folder/FolderAnimationManager.java | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/src/com/android/launcher3/folder/FolderAnimationManager.java b/src/com/android/launcher3/folder/FolderAnimationManager.java index 7adda19ab..3648c60e1 100644 --- a/src/com/android/launcher3/folder/FolderAnimationManager.java +++ b/src/com/android/launcher3/folder/FolderAnimationManager.java @@ -201,20 +201,20 @@ public class FolderAnimationManager { play(a, new RoundedRectRevealOutlineProvider(initialRadius, finalRadius, startRect, endRect).createRevealAnimator(mFolder, !mIsOpening)); + // Animate the elevation midway so that the shadow is not noticeable in the background. + int midDuration = mDuration / 2; + Animator z = getAnimator(mFolder, View.TRANSLATION_Z, -mFolder.getElevation(), 0); + play(a, z, midDuration, midDuration); + a.addListener(new AnimatorListenerAdapter() { @Override public void onAnimationEnd(Animator animation) { super.onAnimationEnd(animation); mFolder.setTranslationX(0.0f); mFolder.setTranslationY(0.0f); + mFolder.setTranslationZ(0.0f); mFolder.setScaleX(1f); mFolder.setScaleY(1f); - - if (mIsOpening) { - getAnimator(mFolder, View.TRANSLATION_Z, -mFolder.getElevation(), 0) - .setDuration(150) - .start(); - } } }); @@ -323,7 +323,12 @@ public class FolderAnimationManager { } private void play(AnimatorSet as, Animator a) { - a.setDuration(mDuration); + play(as, a, a.getStartDelay(), mDuration); + } + + private void play(AnimatorSet as, Animator a, long startDelay, int duration) { + a.setStartDelay(startDelay); + a.setDuration(duration); as.play(a); } |