Skip to content

Commit 920ce4a

Browse files
committed
Merge pull request #35 from lzyzsd/master
fix issue #30
2 parents 21ea093 + a44fa6d commit 920ce4a

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

library/src/main/java/com/daimajia/androidanimations/library/BaseViewAnimator.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,13 @@ public abstract class BaseViewAnimator {
4545

4646
protected abstract void prepare(View target);
4747

48-
public void animate(View target) {
48+
public BaseViewAnimator setTarget(View target) {
4949
reset(target);
5050
prepare(target);
51+
return this;
52+
}
53+
54+
public void animate() {
5155
start();
5256
}
5357

library/src/main/java/com/daimajia/androidanimations/library/YoYo.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ public void stop(boolean reset){
139139
}
140140

141141
private BaseViewAnimator play() {
142+
animator.setTarget(target);
142143
animator.setDuration(duration)
143144
.setInterpolator(interpolator)
144145
.setStartDelay(delay);
@@ -149,7 +150,7 @@ private BaseViewAnimator play() {
149150
}
150151
}
151152

152-
animator.animate(target);
153+
animator.animate();
153154
return animator;
154155
}
155156

0 commit comments

Comments
 (0)