public void scrollTo(float position,boolean decelerate,boolean needsPositionUpdates){
  mNeedsPositionUpdates=needsPositionUpdates;
  if (mScrollAnimator != null)   mScrollAnimator.cancel();
  position=Math.round(position);
  if (mImages != null && mImages.length == 2) {
    if (position < 0)     position=0;
    if (position > 1)     position=1;
  }
  mScrollAnimator=ObjectAnimator.ofFloat(this,POSITION_PROPERTY,mPosition,position);
  mScrollAnimator.setDuration(SCROLL_ANIMATION_DURATION_MS);
  if (decelerate)   mScrollAnimator.setInterpolator(new DecelerateInterpolator());
  mScrollAnimator.start();
}

public void scrollTo ( float position , boolean decelerate , boolean needsPositionUpdates ) { mNeedsPositionUpdates = needsPositionUpdates ; if ( mScrollAnimator != null ) mScrollAnimator . cancel ( ) ; position = Math . round ( position ) ; if ( mImages != null && mImages . length == 2 ) { if ( position < 0 ) position = 0 ; if ( position > 1 ) position = 1 ; } mScrollAnimator = ObjectAnimator . ofFloat ( this , POSITION_PROPERTY , mPosition , position ) ; mScrollAnimator . setDuration ( SCROLL_ANIMATION_DURATION_MS ) ; if ( decelerate ) mScrollAnimator . setInterpolator ( new DecelerateInterpolator ( ) ) ; mScrollAnimator . start ( ) ; }
scrolls imagecarousel to the closest whole position for the desired position .
