Пример #1
0
  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();
      }
    }
  }
Пример #2
0
 @SuppressWarnings({"unused"})
 public int getOffsetToKeepHeaderWhileLoading() {
   return mPtrIndicator.getOffsetToKeepHeaderWhileLoading();
 }