summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/util/UiThreadCircularReveal.java
diff options
context:
space:
mode:
authorTony Wickham <twickham@google.com>2016-07-15 17:23:07 -0700
committerTony Wickham <twickham@google.com>2016-07-19 13:58:51 -0700
commit8f58e61d02fcb0ca90a2803e76a8792ec2c1f99a (patch)
tree2cba823be7962a2100c62acf086784f69fcae0fc /src/com/android/launcher3/util/UiThreadCircularReveal.java
parent1e3d490e08b06750d467e144e5d74ea420c59613 (diff)
downloadandroid_packages_apps_Trebuchet-8f58e61d02fcb0ca90a2803e76a8792ec2c1f99a.tar.gz
android_packages_apps_Trebuchet-8f58e61d02fcb0ca90a2803e76a8792ec2c1f99a.tar.bz2
android_packages_apps_Trebuchet-8f58e61d02fcb0ca90a2803e76a8792ec2c1f99a.zip
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
Diffstat (limited to 'src/com/android/launcher3/util/UiThreadCircularReveal.java')
-rw-r--r--src/com/android/launcher3/util/UiThreadCircularReveal.java57
1 files changed, 0 insertions, 57 deletions
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;
- }
-}