private void completeScroll(boolean postEvents){
  boolean needPopulate=scrollState == SCROLL_STATE_SETTLING;
  if (needPopulate) {
    scroller.abortAnimation();
    int oldX=getScrollX();
    int oldY=getScrollY();
    int x=scroller.getCurrX();
    int y=scroller.getCurrY();
    if (oldX != x || oldY != y) {
      scrollTo(x,y);
      if (x != oldX) {
        pageScrolled(x);
      }
    }
  }
  populatePending=false;
  for (int i=0; i < items.size(); i++) {
    ItemInfo ii=items.get(i);
    if (ii.scrolling) {
      needPopulate=true;
      ii.scrolling=false;
    }
  }
  if (needPopulate) {
    if (postEvents) {
      ViewCompat.postOnAnimation(this,endScrollRunnable);
    }
 else {
      endScrollRunnable.run();
    }
  }
}

private void completeScroll ( boolean postEvents ) { boolean needPopulate = scrollState == SCROLL_STATE_SETTLING ; if ( needPopulate ) { scroller . abortAnimation ( ) ; int oldX = getScrollX ( ) ; int oldY = getScrollY ( ) ; int x = scroller . getCurrX ( ) ; int y = scroller . getCurrY ( ) ; if ( oldX != x || oldY != y ) { scrollTo ( x , y ) ; if ( x != oldX ) { pageScrolled ( x ) ; } } } populatePending = false ; for ( int i = 0 ; i < items . size ( ) ; i ++ ) { ItemInfo ii = items . get ( i ) ; if ( ii . scrolling ) { needPopulate = true ; ii . scrolling = false ; } } if ( needPopulate ) { if ( postEvents ) { ViewCompat . postOnAnimation ( this , endScrollRunnable ) ; } else { endScrollRunnable . run ( ) ; } } }
complete a scroll in progress .
