我正在尝试使用淡入淡出的动画制作按钮动画AnimatorSet
Button fades in > Click button > Remaining buttons fade out
所以为了做到这一点,我想设置onClickListner after the animation is completed
,但这似乎不起作用。单击动画中间的按钮triggers the onClick action
:
setQuestion = new AnimatorSet();
setQuestion.playSequentially(fadeinAnimationQ,fadeinAnimation1,fadeinAnimation2,fadeinAnimation3,fadeinAnimation4,fadeinAnimation5);
setQuestion.start();
这是检查的方法if the animation has finished
。
private void checkAnimation() {
while (true) {
// Check if animation has ended
if (setQuestion.isRunning() == false) {
assignListners();
break;
}
}
}