From c6b3264e16f1d2b72e7f9508559981ce9970157c Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 2 Jun 2014 11:00:09 -0700 Subject: Add setStartValue to RNA Bug: 15198607 Should be good-enough for Ripples to use for pseudo-chaining support. Change-Id: Ia8666928ccb69ae401cb583751632a52bd928b63 --- .../src/com/android/test/hwui/CirclePropActivity.java | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) (limited to 'tests/HwAccelerationTest/src/com') diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java index 5b0aa66..a81e063 100644 --- a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java +++ b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java @@ -118,19 +118,25 @@ public class CirclePropActivity extends Activity { mRadius, mToggle ? 250.0f : 150.0f)); mRunningAnimations.add(new RenderNodeAnimator( - mPaint, RenderNodeAnimator.PAINT_ALPHA, - mToggle ? 64.0f : 255.0f)); - - mRunningAnimations.add(new RenderNodeAnimator( mPaint, RenderNodeAnimator.PAINT_STROKE_WIDTH, mToggle ? 5.0f : 60.0f)); - TimeInterpolator interp = new OvershootInterpolator(3.0f); + mRunningAnimations.add(new RenderNodeAnimator( + mPaint, RenderNodeAnimator.PAINT_ALPHA, 64.0f)); + + // Will be "chained" to run after the above + mRunningAnimations.add(new RenderNodeAnimator( + mPaint, RenderNodeAnimator.PAINT_ALPHA, 255.0f)); + for (int i = 0; i < mRunningAnimations.size(); i++) { RenderNodeAnimator anim = mRunningAnimations.get(i); - anim.setInterpolator(interp); anim.setDuration(1000); anim.setTarget(this); + if (i == (mRunningAnimations.size() - 1)) { + // "chain" test + anim.setStartValue(64.0f); + anim.setStartDelay(anim.getDuration()); + } anim.start(); } -- cgit v1.1