summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorJohn Reck <jreck@google.com>2014-05-14 16:34:14 -0700
committerJohn Reck <jreck@google.com>2014-05-15 08:53:39 -0700
commitff941dcd815021bb20d6504eb486acb1e50592c3 (patch)
tree1d417ed425ed1c08598689f302b31e23d73036f2 /tests
parent951ecb77c5dfe69a4d19d26429286111333ab123 (diff)
downloadframeworks_base-ff941dcd815021bb20d6504eb486acb1e50592c3.zip
frameworks_base-ff941dcd815021bb20d6504eb486acb1e50592c3.tar.gz
frameworks_base-ff941dcd815021bb20d6504eb486acb1e50592c3.tar.bz2
Animator start value...
Change-Id: Ifd35ed95a28c625086d7fa97764fe63ab4a997f1
Diffstat (limited to 'tests')
-rw-r--r--tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java11
-rw-r--r--tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java9
2 files changed, 14 insertions, 6 deletions
diff --git a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
index 1d0a806..e4ea936 100644
--- a/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
+++ b/tests/HwAccelerationTest/src/com/android/test/hwui/CirclePropActivity.java
@@ -109,26 +109,27 @@ public class CirclePropActivity extends Activity {
mToggle = !mToggle;
mRunningAnimations.add(new RenderNodeAnimator(
- mX, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 400.0f : 200.0f));
+ mX, mToggle ? 400.0f : 200.0f));
mRunningAnimations.add(new RenderNodeAnimator(
- mY, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 600.0f : 200.0f));
+ mY, mToggle ? 600.0f : 200.0f));
mRunningAnimations.add(new RenderNodeAnimator(
- mRadius, RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 250.0f : 150.0f));
+ mRadius, mToggle ? 250.0f : 150.0f));
mRunningAnimations.add(new RenderNodeAnimator(
mPaint, RenderNodeAnimator.PAINT_ALPHA,
- RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 64.0f : 255.0f));
+ mToggle ? 64.0f : 255.0f));
mRunningAnimations.add(new RenderNodeAnimator(
mPaint, RenderNodeAnimator.PAINT_STROKE_WIDTH,
- RenderNodeAnimator.DELTA_TYPE_ABSOLUTE, mToggle ? 5.0f : 60.0f));
+ mToggle ? 5.0f : 60.0f));
TimeInterpolator interp = new OvershootInterpolator(3.0f);
for (int i = 0; i < mRunningAnimations.size(); i++) {
RenderNodeAnimator anim = mRunningAnimations.get(i);
anim.setInterpolator(interp);
+ anim.setDuration(1000);
anim.start(this);
}
diff --git a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
index 8f9cf58..b5b12d8 100644
--- a/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
+++ b/tests/RenderThreadTest/src/com/example/renderthread/MainActivity.java
@@ -5,6 +5,7 @@ import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
+import android.util.Log;
import android.view.HardwareRenderer;
import android.view.RenderNodeAnimator;
import android.view.View;
@@ -73,14 +74,20 @@ public class MainActivity extends Activity implements OnItemClickListener {
float delta = (pos - clickedPosition) * 1.1f;
if (delta == 0) delta = -1;
RenderNodeAnimator animator = new RenderNodeAnimator(
- RenderNodeAnimator.TRANSLATION_Y, RenderNodeAnimator.DELTA_TYPE_DELTA, dy * delta);
+ RenderNodeAnimator.TRANSLATION_Y, dy * delta);
animator.setDuration(DURATION);
+ if (child == clickedView) logTranslationY(clickedView);
animator.start(child);
+ if (child == clickedView) logTranslationY(clickedView);
}
//mHandler.postDelayed(mLaunchActivity, (long) (DURATION * .4));
mLaunchActivity.run();
}
+ private void logTranslationY(View v) {
+ Log.d("RTTest", "View has translationY: " + v.getTranslationY());
+ }
+
private Runnable mLaunchActivity = new Runnable() {
@Override