private void finishScrollStacks(){
  cancelAnimation(this,Property.STACK_SNAP);
  final int currentModelIndex=getTabStackIndex();
  float delta=Math.abs(currentModelIndex + mRenderedScrollOffset);
  float target=-currentModelIndex;
  if (delta != 0) {
    long duration=FLING_MIN_DURATION + (long)Math.abs(delta * getFullScrollDistance() / mFlingSpeed);
    addToAnimation(this,Property.STACK_SNAP,mRenderedScrollOffset,target,duration,0);
  }
 else {
    setProperty(Property.STACK_SNAP,target);
    if (mTemporarySelectedStack != null) {
      mTabModelSelector.selectModel(mTemporarySelectedStack);
      mTemporarySelectedStack=null;
    }
  }
}

private void finishScrollStacks ( ) { cancelAnimation ( this , Property . STACK_SNAP ) ; final int currentModelIndex = getTabStackIndex ( ) ; float delta = Math . abs ( currentModelIndex + mRenderedScrollOffset ) ; float target = - currentModelIndex ; if ( delta != 0 ) { long duration = FLING_MIN_DURATION + ( long ) Math . abs ( delta * getFullScrollDistance ( ) / mFlingSpeed ) ; addToAnimation ( this , Property . STACK_SNAP , mRenderedScrollOffset , target , duration , 0 ) ; } else { setProperty ( Property . STACK_SNAP , target ) ; if ( mTemporarySelectedStack != null ) { mTabModelSelector . selectModel ( mTemporarySelectedStack ) ; mTemporarySelectedStack = null ; } } }
animate to the final position of the stack . unfortunately , both touch - up and fling can be called and this depends on fling always being called last . if fling is called first , onuporcancel can override the fling position with the opposite . for example , if the user does a very small fling from incognito to non - incognito , which leaves the up event in the incognito side .
