From 8f58e61d02fcb0ca90a2803e76a8792ec2c1f99a Mon Sep 17 00:00:00 2001 From: Tony Wickham Date: Fri, 15 Jul 2016 17:23:07 -0700 Subject: Update shortcut animations. - Open animation: shortcuts reveal using modified circular reveal (so that it reveals in the pill shape instead of a circle); slight translation away from the original icon; scale icon and text. - Hover animation: scale the shortcut pill and translate others away. Bug: 28980830 Bug: 30127368 Change-Id: I8ed05c7a082f2c2a3f6c663da7259f6cd33e394f --- .../launcher3/util/UiThreadCircularReveal.java | 57 ---------------------- 1 file changed, 57 deletions(-) delete mode 100644 src/com/android/launcher3/util/UiThreadCircularReveal.java (limited to 'src/com/android/launcher3/util/UiThreadCircularReveal.java') diff --git a/src/com/android/launcher3/util/UiThreadCircularReveal.java b/src/com/android/launcher3/util/UiThreadCircularReveal.java deleted file mode 100644 index f2b5e5e15..000000000 --- a/src/com/android/launcher3/util/UiThreadCircularReveal.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.android.launcher3.util; - -import android.animation.Animator; -import android.animation.AnimatorListenerAdapter; -import android.animation.ValueAnimator; -import android.animation.ValueAnimator.AnimatorUpdateListener; -import android.annotation.TargetApi; -import android.os.Build; -import android.view.View; -import android.view.ViewOutlineProvider; - -import com.android.launcher3.Utilities; - -@TargetApi(Build.VERSION_CODES.LOLLIPOP) -public class UiThreadCircularReveal { - - public static ValueAnimator createCircularReveal(View v, int x, int y, float r0, float r1) { - return createCircularReveal(v, x, y, r0, r1, ViewOutlineProvider.BACKGROUND); - } - - public static ValueAnimator createCircularReveal(View v, int x, int y, float r0, float r1, - final ViewOutlineProvider originalProvider) { - ValueAnimator va = ValueAnimator.ofFloat(0f, 1f); - - final View revealView = v; - final RevealOutlineProvider outlineProvider = new RevealOutlineProvider(x, y, r0, r1); - final float elevation = v.getElevation(); - - va.addListener(new AnimatorListenerAdapter() { - public void onAnimationStart(Animator animation) { - revealView.setOutlineProvider(outlineProvider); - revealView.setClipToOutline(true); - revealView.setTranslationZ(-elevation); - } - - public void onAnimationEnd(Animator animation) { - revealView.setOutlineProvider(originalProvider); - revealView.setClipToOutline(false); - revealView.setTranslationZ(0); - } - - }); - - va.addUpdateListener(new AnimatorUpdateListener() { - @Override - public void onAnimationUpdate(ValueAnimator arg0) { - float progress = arg0.getAnimatedFraction(); - outlineProvider.setProgress(progress); - revealView.invalidateOutline(); - if (!Utilities.ATLEAST_LOLLIPOP_MR1) { - revealView.invalidate(); - } - } - }); - return va; - } -} -- cgit v1.2.3