public boolean computeScrollOffset(){
  if (mFinished) {
    return false;
  }
  int timePassed=(int)(AnimationUtils.currentAnimationTimeMillis() - mStartTime);
  if (timePassed < mDuration) {
switch (mMode) {
case SCROLL_MODE:
      float x=timePassed * mDurationReciprocal;
    if (mInterpolator == null)     x=viscousFluid(x);
 else     x=mInterpolator.getInterpolation(x);
  mCurrX=mStartX + Math.round(x * mDeltaX);
mCurrY=mStartY + Math.round(x * mDeltaY);
break;
case FLING_MODE:
final float t=(float)timePassed / mDuration;
final int index=(int)(NB_SAMPLES * t);
float distanceCoef=1.f;
float velocityCoef=0.f;
if (index < NB_SAMPLES) {
final float t_inf=(float)index / NB_SAMPLES;
final float t_sup=(float)(index + 1) / NB_SAMPLES;
final float d_inf=SPLINE_POSITION[index];
final float d_sup=SPLINE_POSITION[index + 1];
velocityCoef=(d_sup - d_inf) / (t_sup - t_inf);
distanceCoef=d_inf + (t - t_inf) * velocityCoef;
}
mCurrVelocity=velocityCoef * mDistance / mDuration * 1000.0f;
mCurrX=mStartX + Math.round(distanceCoef * (mFinalX - mStartX));
mCurrX=Math.min(mCurrX,mMaxX);
mCurrX=Math.max(mCurrX,mMinX);
mCurrY=mStartY + Math.round(distanceCoef * (mFinalY - mStartY));
mCurrY=Math.min(mCurrY,mMaxY);
mCurrY=Math.max(mCurrY,mMinY);
if (mCurrX == mFinalX && mCurrY == mFinalY) {
mFinished=true;
}
break;
}
}
 else {
mCurrX=mFinalX;
mCurrY=mFinalY;
mFinished=true;
}
return true;
}

public boolean computeScrollOffset ( ) { if ( mFinished ) { return false ; } int timePassed = ( int ) ( AnimationUtils . currentAnimationTimeMillis ( ) - mStartTime ) ; if ( timePassed < mDuration ) { switch ( mMode ) { case SCROLL_MODE : float x = timePassed * mDurationReciprocal ; if ( mInterpolator == null ) x = viscousFluid ( x ) ; else x = mInterpolator . getInterpolation ( x ) ; mCurrX = mStartX + Math . round ( x * mDeltaX ) ; mCurrY = mStartY + Math . round ( x * mDeltaY ) ; break ; case FLING_MODE : final float t = ( float ) timePassed / mDuration ; final int index = ( int ) ( NB_SAMPLES * t ) ; float distanceCoef = 1.f ; float velocityCoef = 0.f ; if ( index < NB_SAMPLES ) { final float t_inf = ( float ) index / NB_SAMPLES ; final float t_sup = ( float ) ( index + 1 ) / NB_SAMPLES ; final float d_inf = SPLINE_POSITION [ index ] ; final float d_sup = SPLINE_POSITION [ index + 1 ] ; velocityCoef = ( d_sup - d_inf ) / ( t_sup - t_inf ) ; distanceCoef = d_inf + ( t - t_inf ) * velocityCoef ; } mCurrVelocity = velocityCoef * mDistance / mDuration * 1000.0f ; mCurrX = mStartX + Math . round ( distanceCoef * ( mFinalX - mStartX ) ) ; mCurrX = Math . min ( mCurrX , mMaxX ) ; mCurrX = Math . max ( mCurrX , mMinX ) ; mCurrY = mStartY + Math . round ( distanceCoef * ( mFinalY - mStartY ) ) ; mCurrY = Math . min ( mCurrY , mMaxY ) ; mCurrY = Math . max ( mCurrY , mMinY ) ; if ( mCurrX == mFinalX && mCurrY == mFinalY ) { mFinished = true ; } break ; } } else { mCurrX = mFinalX ; mCurrY = mFinalY ; mFinished = true ; } return true ; }
call this when you want to know the new location . if it returns true , the animation is not yet finished .
