Tweaks to synchronized app transitions.
* Animations appear snappier by using new interpolators ie. new EXAGGERATED_EASE and updated AGGRESSIVE_EASE_IN_OUT * Updated app icon/window alpha to make the motion/synchronization clearer. Bug: 70220260 Change-Id: Ib05efc7f58d53b070e58f682f30651e31f9b3524
This commit is contained in:
parent
bd3a798aa2
commit
863e05556e
|
@ -432,6 +432,8 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
|
|||
boolean isBelowCenterY = lp.topMargin < centerY;
|
||||
x.setDuration(isBelowCenterY ? 500 : 233);
|
||||
y.setDuration(isBelowCenterY ? 233 : 500);
|
||||
x.setInterpolator(Interpolators.AGGRESSIVE_EASE);
|
||||
y.setInterpolator(Interpolators.AGGRESSIVE_EASE);
|
||||
appIconAnimatorSet.play(x);
|
||||
appIconAnimatorSet.play(y);
|
||||
|
||||
|
@ -444,18 +446,18 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
|
|||
ObjectAnimator sY = ObjectAnimator.ofFloat(mFloatingView, View.SCALE_Y, 1f, scale);
|
||||
sX.setDuration(500);
|
||||
sY.setDuration(500);
|
||||
sX.setInterpolator(Interpolators.EXAGGERATED_EASE);
|
||||
sY.setInterpolator(Interpolators.EXAGGERATED_EASE);
|
||||
appIconAnimatorSet.play(sX);
|
||||
appIconAnimatorSet.play(sY);
|
||||
|
||||
// Fade out the app icon.
|
||||
ObjectAnimator alpha = ObjectAnimator.ofFloat(mFloatingView, View.ALPHA, 1f, 0f);
|
||||
alpha.setStartDelay(17);
|
||||
alpha.setDuration(33);
|
||||
alpha.setStartDelay(32);
|
||||
alpha.setDuration(50);
|
||||
alpha.setInterpolator(Interpolators.LINEAR);
|
||||
appIconAnimatorSet.play(alpha);
|
||||
|
||||
for (Animator a : appIconAnimatorSet.getChildAnimations()) {
|
||||
a.setInterpolator(Interpolators.AGGRESSIVE_EASE);
|
||||
}
|
||||
return appIconAnimatorSet;
|
||||
}
|
||||
|
||||
|
@ -516,9 +518,9 @@ public class LauncherAppTransitionManagerImpl extends LauncherAppTransitionManag
|
|||
|
||||
// Fade in the app window.
|
||||
float alphaDelay = 0;
|
||||
float alphaDuration = 50;
|
||||
float alphaDuration = 60;
|
||||
float alpha = getValue(0f, 1f, alphaDelay, alphaDuration,
|
||||
appAnimator.getDuration() * percent, Interpolators.AGGRESSIVE_EASE);
|
||||
appAnimator.getDuration() * percent, Interpolators.LINEAR);
|
||||
|
||||
// Animate the window crop so that it starts off as a square, and then reveals
|
||||
// horizontally.
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
|
||||
package com.android.launcher3.anim;
|
||||
|
||||
import android.graphics.Path;
|
||||
import android.view.animation.AccelerateInterpolator;
|
||||
import android.view.animation.DecelerateInterpolator;
|
||||
import android.view.animation.Interpolator;
|
||||
|
@ -44,9 +45,19 @@ public class Interpolators {
|
|||
public static final Interpolator FAST_OUT_SLOW_IN = new PathInterpolator(0.4f, 0f, 0.2f, 1f);
|
||||
|
||||
public static final Interpolator AGGRESSIVE_EASE = new PathInterpolator(0.2f, 0f, 0f, 1f);
|
||||
public static final Interpolator AGGRESSIVE_EASE_IN_OUT = new PathInterpolator(0.8f,0, 0.4f, 1);
|
||||
public static final Interpolator AGGRESSIVE_EASE_IN_OUT = new PathInterpolator(0.6f,0, 0.4f, 1);
|
||||
|
||||
public static final Interpolator APP_CLOSE_ALPHA = new PathInterpolator(0.9f, 0, 1f, 1f);
|
||||
public static final Interpolator EXAGGERATED_EASE;
|
||||
|
||||
static {
|
||||
Path exaggeratedEase = new Path();
|
||||
exaggeratedEase.moveTo(0, 0);
|
||||
exaggeratedEase.cubicTo(0.05f, 0f, 0.133333f, 0.08f, 0.166666f, 0.4f);
|
||||
exaggeratedEase.cubicTo(0.225f, 0.94f, 0.5f, 1f, 1f, 1f);
|
||||
EXAGGERATED_EASE = new PathInterpolator(exaggeratedEase);
|
||||
}
|
||||
|
||||
public static final Interpolator APP_CLOSE_ALPHA = new PathInterpolator(0.4f, 0, 1f, 1f);
|
||||
|
||||
public static final Interpolator OVERSHOOT_0 = new OvershootInterpolator(0);
|
||||
|
||||
|
|
Loading…
Reference in New Issue