Сейчас я обнаруживаю конец моего ValueAnimator, проверяя, достиг ли прогресс 100...
//Setup the animation
ValueAnimator anim = ValueAnimator.ofInt(progress, seekBar.getMax());
//Set the duration
anim.setDuration(Utility.setAnimationDuration(progress));
anim.addUpdateListener(new AnimatorUpdateListener()
{
@Override
public void onAnimationUpdate(ValueAnimator animation)
{
int animProgress = (Integer) animation.getAnimatedValue();
if ( animProgress == 100)
{
//Done
}
else
{
seekBar.setProgress(animProgress);
}
}
});
Правильно ли это? Я прочитал документы и не смог найти ни одного слушателя или обратного вызова, когда он будет завершен. Я попытался использовать isRunning()
, но это не сработало.