Skip to content

Commit 00e67dc

Browse files
committed
Update Android动画.md
1 parent 269f9f3 commit 00e67dc

File tree

1 file changed

+13
-7
lines changed

1 file changed

+13
-7
lines changed

Android基础/Android动画.md

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -158,16 +158,22 @@ The property animation system is a robust framework that allows you to animate a
158158
159159
以下例子同时应用5个动画:
160160
161-
- 播放anim1;
162-
- 同时播放anim2,anim3,anim4;
163-
- 播放anim5。
161+
- Plays bounceAnim.
162+
- Plays squashAnim1, squashAnim2, stretchAnim1, and stretchAnim2 at the same time.
163+
- Plays bounceBackAnim.
164+
- Plays fadeAnim.
164165
165166
```java
166167
AnimatorSet bouncer = new AnimatorSet();
167-
bouncer.play(anim1).before(anim2);
168-
bouncer.play(anim2).with(anim3);
169-
bouncer.play(anim2).with(anim4)
170-
bouncer.play(anim5).after(amin2);
168+
bouncer.play(bounceAnim).before(squashAnim1);
169+
bouncer.play(squashAnim1).with(squashAnim2);
170+
bouncer.play(squashAnim1).with(stretchAnim1);
171+
bouncer.play(squashAnim1).with(stretchAnim2);
172+
bouncer.play(bounceBackAnim).after(stretchAnim2);
173+
ValueAnimator fadeAnim = ObjectAnimator.ofFloat(newBall, "alpha", 1f, 0f);
174+
fadeAnim.setDuration(250);
175+
AnimatorSet animatorSet = new AnimatorSet();
176+
animatorSet.play(bouncer).before(fadeAnim);
171177
animatorSet.start();
172178
```
173179

0 commit comments

Comments
 (0)