diff options
| author | Chet Haase <chet@google.com> | 2010-10-14 06:59:27 -0700 |
|---|---|---|
| committer | Chet Haase <chet@google.com> | 2010-10-14 13:13:07 -0700 |
| commit | e358b47be5a1c1a775a376925ea063b51ec3a3f9 (patch) | |
| tree | 57193b5498e0451f653364e3ab86b9292893efeb /samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java | |
| parent | ec8a83055a484d8cc12033808d31864068557136 (diff) | |
Updating code to use new non-generified animator APIs
Change-Id: I3023db9d1f9cb8bf98b788fce4ae2b58b182987d
Diffstat (limited to 'samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java')
| -rw-r--r-- | samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java b/samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java index 650f3509c..81ece1846 100644 --- a/samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java +++ b/samples/ApiDemos/src/com/example/android/apis/animation/AnimatorEvents.java @@ -117,28 +117,28 @@ public class AnimatorEvents extends Activity { private void createAnimation() { if (animation == null) { - ObjectAnimator yAnim = new ObjectAnimator(1500, ball, "y", - ball.getY(), getHeight() - 50f); + ObjectAnimator yAnim = ObjectAnimator.ofFloat(ball, "y", + ball.getY(), getHeight() - 50f).setDuration(1500); yAnim.setRepeatCount(0); yAnim.setRepeatMode(ValueAnimator.REVERSE); yAnim.setInterpolator(new AccelerateInterpolator(2f)); yAnim.addUpdateListener(this); yAnim.addListener(this); - ObjectAnimator xAnim = new ObjectAnimator(1000, ball, "x", - ball.getX(), ball.getX() + 300); + ObjectAnimator xAnim = ObjectAnimator.ofFloat(ball, "x", + ball.getX(), ball.getX() + 300).setDuration(1000); xAnim.setStartDelay(0); xAnim.setRepeatCount(0); xAnim.setRepeatMode(ValueAnimator.REVERSE); xAnim.setInterpolator(new AccelerateInterpolator(2f)); - ObjectAnimator alphaAnim = new ObjectAnimator(1000, ball, "alpha", 1f, .5f); + ObjectAnimator alphaAnim = ObjectAnimator.ofFloat(ball, "alpha", 1f, .5f). + setDuration(1000); AnimatorSet alphaSeq = new AnimatorSet(); alphaSeq.play(alphaAnim); animation = new AnimatorSet(); ((AnimatorSet) animation).playTogether(yAnim, xAnim); - //((AnimatorSet) animation).play(alphaSeq).after(500); animation.addListener(this); } } |
