private Animator animateListToWidth(int delay,int duration,TimeInterpolator interpolator,int... width){
  if (mAnimatorSet != null && mAnimatorSet.isRunning()) {
    mAnimatorSet.end();
  }
  ArrayList<Animator> animators=new ArrayList<Animator>();
  boolean animateModeItemsInOrder=true;
  if (delay < 0) {
    animateModeItemsInOrder=false;
    delay*=-1;
  }
  for (int i=0; i < mTotalModes; i++) {
    ObjectAnimator animator;
    if (animateModeItemsInOrder) {
      animator=ObjectAnimator.ofInt(mModeSelectorItems[i],"visibleWidth",width);
    }
 else {
      animator=ObjectAnimator.ofInt(mModeSelectorItems[mTotalModes - 1 - i],"visibleWidth",width);
    }
    animator.setDuration(duration);
    animators.add(animator);
  }
  mAnimatorSet=new AnimatorSet();
  mAnimatorSet.playTogether(animators);
  mAnimatorSet.setInterpolator(interpolator);
  mAnimatorSet.start();
  return mAnimatorSet;
}

private Animator animateListToWidth ( int delay , int duration , TimeInterpolator interpolator , int ... width ) { if ( mAnimatorSet != null && mAnimatorSet . isRunning ( ) ) { mAnimatorSet . end ( ) ; } ArrayList < Animator > animators = new ArrayList < Animator > ( ) ; boolean animateModeItemsInOrder = true ; if ( delay < 0 ) { animateModeItemsInOrder = false ; delay *= - 1 ; } for ( int i = 0 ; i < mTotalModes ; i ++ ) { ObjectAnimator animator ; if ( animateModeItemsInOrder ) { animator = ObjectAnimator . ofInt ( mModeSelectorItems [ i ] , "visibleWidth" , width ) ; } else { animator = ObjectAnimator . ofInt ( mModeSelectorItems [ mTotalModes - 1 - i ] , "visibleWidth" , width ) ; } animator . setDuration ( duration ) ; animators . add ( animator ) ; } mAnimatorSet = new AnimatorSet ( ) ; mAnimatorSet . playTogether ( animators ) ; mAnimatorSet . setInterpolator ( interpolator ) ; mAnimatorSet . start ( ) ; return mAnimatorSet ; }
animate the mode list between the given set of visible width .
