Merge "Reverse order of RT animations so enter animation works correctly"

This commit is contained in:
Alan Viverette
2015-08-24 21:45:43 +00:00
committed by Android (Google) Code Review

View File

@@ -131,15 +131,7 @@ class RippleBackground extends RippleComponent {
mPropX = CanvasProperty.createFloat(0);
mPropY = CanvasProperty.createFloat(0);
// Linear "fast" enter based on current opacity.
final int fastEnterDuration = (int) ((1 - mOpacity) * OPACITY_ENTER_DURATION_FAST);
if (fastEnterDuration > 0) {
final RenderNodeAnimator enter = new RenderNodeAnimator(
mPropPaint, RenderNodeAnimator.PAINT_ALPHA, targetAlpha);
enter.setInterpolator(LINEAR_INTERPOLATOR);
enter.setDuration(fastEnterDuration);
set.add(enter);
}
// Linear exit after enter is completed.
final RenderNodeAnimator exit = new RenderNodeAnimator(
@@ -149,6 +141,15 @@ class RippleBackground extends RippleComponent {
exit.setStartDelay(fastEnterDuration);
set.add(exit);
// Linear "fast" enter based on current opacity.
if (fastEnterDuration > 0) {
final RenderNodeAnimator enter = new RenderNodeAnimator(
mPropPaint, RenderNodeAnimator.PAINT_ALPHA, targetAlpha);
enter.setInterpolator(LINEAR_INTERPOLATOR);
enter.setDuration(fastEnterDuration);
set.add(enter);
}
return set;
}