boolean computeAngleOffset(){
  if (mFinished) {
    return false;
  }
  long systemClock=AnimationUtils.currentAnimationTimeMillis();
  long timePassed=systemClock - mStartMillis;
  if (timePassed < mDurationMillis) {
switch (mMode) {
case SCROLL_MODE:
      float sc=(float)timePassed / mDurationMillis;
    mCurrAngleDeg=mStartAngleDeg + Math.round(mDeltaAngleDeg * sc);
  break;
case FLING_MODE:
float timePassedSeconds=timePassed / 1000.0f;
float distance=mCoeffVelocity * mVelocity * timePassedSeconds - (DECELERATION * timePassedSeconds * timePassedSeconds / 2.0f);
mCurrAngleDeg=mStartAngleDeg + Math.round(distance);
break;
}
return true;
}
 else {
mFinished=true;
return false;
}
}

boolean computeAngleOffset ( ) { if ( mFinished ) { return false ; } long systemClock = AnimationUtils . currentAnimationTimeMillis ( ) ; long timePassed = systemClock - mStartMillis ; if ( timePassed < mDurationMillis ) { switch ( mMode ) { case SCROLL_MODE : float sc = ( float ) timePassed / mDurationMillis ; mCurrAngleDeg = mStartAngleDeg + Math . round ( mDeltaAngleDeg * sc ) ; break ; case FLING_MODE : float timePassedSeconds = timePassed / 1000.0f ; float distance = mCoeffVelocity * mVelocity * timePassedSeconds - ( DECELERATION * timePassedSeconds * timePassedSeconds / 2.0f ) ; mCurrAngleDeg = mStartAngleDeg + Math . round ( distance ) ; break ; } return true ; } else { mFinished = true ; return false ; } }
call this when you want to know the new location . if it returns true , the animation is not yet finished . loc will be altered to provide the new location .
