daimajia / daimajia/AndroidViewAnimations

delay() doesn't work on onAnimationStart()

Open
#130 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
12.4k
Forks
2.4k
PR merge metrics
No merged PRs in 30d

Description

YoYo.with(Techniques.FadeInDown)
.duration(500)
.delay(2000)
.withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
textView.setVisibility(View.VISIBLE);
}
...
})
.playOn(textView);

onAnimationStart() will be called immediately when I call playOn()
so I have to fix it like this:

new Handler().postDelayed(new Runnable() {
@Override
public void run() {
YoYo.with(Techniques.FadeInDown)
.duration(500)
.withListener(new Animator.AnimatorListener() {
@Override
public void onAnimationStart(Animator animation) {
textView.setVisibility(View.VISIBLE);
}
...
})
.playOn(textView);
}
},2000);

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.