protected void onRefreshing(boolean doScroll) {
    super.onRefreshing(doScroll);

    if (getShowIndicatorInternal()) {
      updateIndicatorViewsVisibility();
    }
  }
  @Override
  protected void onReset() {
    super.onReset();

    if (getShowIndicatorInternal()) {
      updateIndicatorViewsVisibility();
    }
  }
  @Override
  protected void setRefreshingInternal(boolean doScroll) {
    super.setRefreshingInternal(doScroll);

    if (getShowIndicatorInternal()) {
      updateIndicatorViewsVisibility();
    }
  }
  @Override
  public final void onScroll(
      final AbsListView view,
      final int firstVisibleItem,
      final int visibleItemCount,
      final int totalItemCount) {

    if (DEBUG) {
      Log.d(
          LOG_TAG,
          "First Visible: "
              + firstVisibleItem
              + ". Visible Count: "
              + visibleItemCount
              + ". Total Items: "
              + totalItemCount);
    }

    // If we have a OnItemVisibleListener, do check...
    if (null != mOnLastItemVisibleListener) {

      // Detect whether the last visible item has changed
      final int lastVisibleItemIndex = firstVisibleItem + visibleItemCount;

      /**
       * Check that the last item has changed, we have any items, and that the last item is visible.
       * lastVisibleItemIndex is a zero-based index, so we add one to it to check against
       * totalItemCount.
       */
      if (visibleItemCount > 0 && lastVisibleItemIndex + 1 == totalItemCount) {
        if (lastVisibleItemIndex != mSavedLastVisibleIndex) {
          mSavedLastVisibleIndex = lastVisibleItemIndex;
          mOnLastItemVisibleListener.onLastItemVisible();
        }
      }
    }

    // If we're showing the indicator, check positions...
    if (getShowIndicatorInternal()) {
      updateIndicatorViewsVisibility();
    }

    // Finally call OnScrollListener if we have one
    if (null != mOnScrollListener) {
      mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
    }
  }
  public final void onScroll(
      final AbsListView view,
      final int firstVisibleItem,
      final int visibleItemCount,
      final int totalItemCount) {

    if (DEBUG) {
      Log.d(
          LOG_TAG,
          "First Visible: "
              + firstVisibleItem
              + ". Visible Count: "
              + visibleItemCount
              + ". Total Items:"
              + totalItemCount);
    }

    /**
     * Set whether the Last Item is Visible. lastVisibleItemIndex is a zero-based index, so we minus
     * one totalItemCount to check
     */
    if (null != mOnLastItemVisibleListener) {
      mLastItemVisible =
          (totalItemCount > 0) && (firstVisibleItem + visibleItemCount >= totalItemCount - 1);
    }

    // If we're showing the indicator, check positions...
    if (getShowIndicatorInternal()) {
      updateIndicatorViewsVisibility();
    }

    // Finally call OnScrollListener if we have one
    if (null != mOnScrollListener) {
      mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
    }
  }