code: public void setRefreshing(boolean refreshing) {
          if (refreshing && mRefreshing != refreshing) {
              // scale and show
              mRefreshing = refreshing;
              int endTarget = 0;
              if (!mUsingCustomStart) {
                  switch (mDirection) {
                      case BOTTOM:
                          endTarget = getMeasuredHeight() - (int) (mSpinnerFinalOffset);
                          break;
                      case TOP:
                      default:
                          endTarget = (int) (mSpinnerFinalOffset - Math.abs(mOriginalOffsetTop));
                          break;
                  }
              } else {
                  endTarget = (int) mSpinnerFinalOffset;
              }
              setTargetOffsetTopAndBottom(endTarget - mCurrentTargetOffsetTop,
                      true /* requires update */);
              mNotify = false;
              startScaleUpAnimation(mRefreshListener);
          } else {
              setRefreshing(refreshing, false /* notify */);
          }
      }
docs: Notify the widget that refresh state has changed. Do not call this when
  refresh is triggered by a swipe gesture.
  
  @param refreshing Whether or not the view should show refresh progress.