summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-07-29 11:22:21 -0700
committerTony <twickham@google.com>2016-08-02 11:09:16 -0700
commit0ba81607e30c008a7aa24ca76d74f9c4aaafd053 (patch)
treedb51b5e343c47a4998dd0d264919941e562aeaa8 /src/com/android/launcher3/util
parent1460475626e069cc8ee9c71057f40e8aabfc676f (diff)
downloadandroid_packages_apps_Trebuchet-0ba81607e30c008a7aa24ca76d74f9c4aaafd053.tar.gz
android_packages_apps_Trebuchet-0ba81607e30c008a7aa24ca76d74f9c4aaafd053.tar.bz2
android_packages_apps_Trebuchet-0ba81607e30c008a7aa24ca76d74f9c4aaafd053.zip
Start shortcuts close animation where open left off.
- Before we always started the close animation at 0 instead of the previous open progress, which looked janky. - Shortened the animations' durations and start delays to account for the fact that the open animation was only partially finished when the close animation started. Bug: 30465231 Change-Id: I958ee5f4543dbf1185f3d0229c55fc1b51929655
Diffstat (limited to 'src/com/android/launcher3/util')
-rw-r--r--src/com/android/launcher3/util/RevealOutlineAnimation.java17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/com/android/launcher3/util/RevealOutlineAnimation.java b/src/com/android/launcher3/util/RevealOutlineAnimation.java
index cd9888232..456047775 100644
--- a/src/com/android/launcher3/util/RevealOutlineAnimation.java
+++ b/src/com/android/launcher3/util/RevealOutlineAnimation.java
@@ -38,6 +38,8 @@ public abstract class RevealOutlineAnimation extends ViewOutlineProvider {
final float elevation = revealView.getElevation();
va.addListener(new AnimatorListenerAdapter() {
+ private boolean mWasCanceled = false;
+
public void onAnimationStart(Animator animation) {
revealView.setOutlineProvider(RevealOutlineAnimation.this);
revealView.setClipToOutline(true);
@@ -46,11 +48,18 @@ public abstract class RevealOutlineAnimation extends ViewOutlineProvider {
}
}
+ @Override
+ public void onAnimationCancel(Animator animation) {
+ mWasCanceled = true;
+ }
+
public void onAnimationEnd(Animator animation) {
- revealView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
- revealView.setClipToOutline(false);
- if (shouldRemoveElevationDuringAnimation()) {
- revealView.setTranslationZ(0);
+ if (!mWasCanceled) {
+ revealView.setOutlineProvider(ViewOutlineProvider.BACKGROUND);
+ revealView.setClipToOutline(false);
+ if (shouldRemoveElevationDuringAnimation()) {
+ revealView.setTranslationZ(0);
+ }
}
}