summaryrefslogtreecommitdiff
path: root/samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java
diff options
context:
space:
mode:
authorChet Haase <chet@google.com>2010-10-14 06:59:27 -0700
committerChet Haase <chet@google.com>2010-10-14 13:13:07 -0700
commite358b47be5a1c1a775a376925ea063b51ec3a3f9 (patch)
tree57193b5498e0451f653364e3ab86b9292893efeb /samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java
parentec8a83055a484d8cc12033808d31864068557136 (diff)
Updating code to use new non-generified animator APIs
Change-Id: I3023db9d1f9cb8bf98b788fce4ae2b58b182987d
Diffstat (limited to 'samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java')
-rw-r--r--samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java b/samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java
index 71d246016..f8f2da5b5 100644
--- a/samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java
+++ b/samples/ApiDemos/src/com/example/android/apis/animation/AnimationCloning.java
@@ -79,18 +79,18 @@ public class AnimationCloning extends Activity {
private void createAnimation() {
if (animation == null) {
- ObjectAnimator anim1 = new ObjectAnimator(500, balls.get(0), "y",
- 0f, getHeight() - balls.get(0).getHeight());
+ ObjectAnimator anim1 = ObjectAnimator.ofFloat(balls.get(0), "y",
+ 0f, getHeight() - balls.get(0).getHeight()).setDuration(500);
ObjectAnimator anim2 = anim1.clone();
anim2.setTarget(balls.get(1));
anim1.addUpdateListener(this);
ShapeHolder ball2 = balls.get(2);
- ObjectAnimator animDown = new ObjectAnimator(500, ball2, "y",
- 0f, getHeight() - ball2.getHeight());
+ ObjectAnimator animDown = ObjectAnimator.ofFloat(ball2, "y",
+ 0f, getHeight() - ball2.getHeight()).setDuration(500);
animDown.setInterpolator(new AccelerateInterpolator());
- ObjectAnimator animUp = new ObjectAnimator(500, ball2, "y",
- getHeight() - ball2.getHeight(), 0f);
+ ObjectAnimator animUp = ObjectAnimator.ofFloat(ball2, "y",
+ getHeight() - ball2.getHeight(), 0f).setDuration(500);
animDown.setInterpolator(new DecelerateInterpolator());
AnimatorSet s1 = new AnimatorSet();
s1.playSequentially(animDown, animUp);