我怎么知道ObjectAnimator已经运行过?

时间:2016-01-09 04:29:32

标签: android objectanimator

我将三个ObjectAnimator放入AnimatorSet,当我取消AnimatorSetAnimatorSet完成后,我需要记录getAnimatedValue。但是,当我取消AnimatorSet时,ObjectAnimator可能没有运行,我可以在isRunning中呼叫onAnimationCancel,但我如何判断此ObjectAnimator已经过了onAnimationEnd animatorSet.addListener(new Animator.AnimatorListener() { @Override public void onAnimationStart(Animator animation) { } @Override public void onAnimationEnd(Animator animation) { mSunMovPos = (float) sunAnimator.getAnimatedValue(); mCurSunSetColor = (int) sunSetAnimator.getAnimatedValue(); //How do judge nightAnimator had runned ? mCurNightColor = (int) nightAnimator.getAnimatedValue(); } @Override public void onAnimationCancel(Animator animation) { mSunMovPos = (float) sunAnimator.getAnimatedValue(); mCurSunSetColor = (int) sunSetAnimator.getAnimatedValue(); if (nightAnimator.isRunning()) mCurNightColor = (int) nightAnimator.getAnimatedValue(); } @Override public void onAnimationRepeat(Animator animation) { } });

LocalNotification( 
     id,fireDate, alertTitle, alertBody, alertAction,
     userInfo, launchImage, applicationIconBadgeNumber,
     hasAction, repeatInterval, sound, smallIcon, autoCancel,
     number, when, usesChronometer, vibrate, ticker, subText,
     priority, actions, progress, bigText, bigPicture
 );

0 个答案:

没有答案