From ff941dcd815021bb20d6504eb486acb1e50592c3 Mon Sep 17 00:00:00 2001 From: John Reck Date: Wed, 14 May 2014 16:34:14 -0700 Subject: Animator start value... Change-Id: Ifd35ed95a28c625086d7fa97764fe63ab4a997f1 --- .../src/com/example/renderthread/MainActivity.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'tests/RenderThreadTest/src/com') 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 -- cgit v1.1