コード例 #1
0
 public void start() {
   if (mStarted) return;
   checkState();
   mRunCount = 0;
   mStarted = true;
   mStartTime = AnimationUtils.currentAnimationTimeMillis();
   Compat.postOnAnimation(mView, this);
 }
コード例 #2
0
    @Override
    public final void run() {
      if (!mStarted) return;

      final long timeElapsed = AnimationUtils.currentAnimationTimeMillis() - mStartTime;
      mAnimationValue = mInterpolator.getInterpolation(timeElapsed / (float) mDuration);

      onAnimationUpdate();

      if (timeElapsed < mDuration) {
        Compat.postOnAnimation(mView, this);
      } else {
        if (++mRunCount < mRepeatCount || mRepeatCount == INFINITE) {
          restart();
        }
      }
    }
コード例 #3
0
 private void restart() {
   mStartTime = AnimationUtils.currentAnimationTimeMillis();
   Compat.postOnAnimation(mView, this);
 }