private void onRelease(boolean stayForLoading) {

    tryToPerformRefresh();

    if (mStatus == PTR_STATUS_LOADING) {
      // keep header for fresh
      if (mKeepHeaderWhenRefresh) {
        // scroll header back
        if (mPtrIndicator.isOverOffsetToKeepHeaderWhileLoading() && !stayForLoading) {
          mScrollChecker.tryToScrollTo(
              mPtrIndicator.getOffsetToKeepHeaderWhileLoading(), mDurationToClose);
        } else {
          // do nothing
        }
      } else {
        tryScrollBackToTopWhileLoading();
      }
    } else {
      if (mStatus == PTR_STATUS_COMPLETE) {
        notifyUIRefreshComplete(false);
      } else {
        tryScrollBackToTopAbortRefresh();
      }
    }
  }
  /** Do refresh complete work when time elapsed is greater than {@link #mLoadingMinTime} */
  private void performRefreshComplete() {
    mStatus = PTR_STATUS_COMPLETE;

    // if is auto refresh do nothing, wait scroller stop
    if (mScrollChecker.mIsRunning && isAutoRefresh()) {
      // do nothing
      if (DEBUG) {
        PtrCLog.d(
            LOG_TAG,
            "performRefreshComplete do nothing, scrolling: %s, auto refresh: %s",
            mScrollChecker.mIsRunning,
            mFlag);
      }
      return;
    }

    notifyUIRefreshComplete(false);
  }