public void onScroll(AbsListView abslistview, int i, int j, int k) {
   if (mPinnedHeaderAdapter != null) {
     PinnedHeaderAdapter.PinnedHeaderStatus pinnedheaderstatus =
         mPinnedHeaderAdapter.getPinnedHeaderStatus(mNavBottom);
     if (pinnedheaderstatus != null) {
       mPinnedHeaderOffset = pinnedheaderstatus.pinnedHeaderOffset;
       mPinnedHeaderIsVisible = pinnedheaderstatus.pinnedHeaderIsVisible;
       if (pinnedheaderstatus.shouldRequestNewView) {
         mPinnedHeaderHeight = mPinnedHeaderAdapter.getPinnedHeaderHeight();
         mPinnedHeaderView = mPinnedHeaderAdapter.getPinnedHeaderView(mPinnedHeaderView);
         if (mPinnedHeaderView != null) {
           ensureHeaderHasLayoutParams(mPinnedHeaderView);
           measureHeader(mPinnedHeaderView);
           mPinnedHeaderAdapter.layoutPinnedHeader(
               mPinnedHeaderView,
               0,
               mPinnedHeaderOffset + mNavBottom,
               getWidth(),
               mNavBottom + mPinnedHeaderOffset + mPinnedHeaderHeight);
         }
       }
     }
   }
   if (mOnScrollListener != null) {
     mOnScrollListener.onScroll(abslistview, i, j, k);
   }
 }
 /**
  * Notifies the OnScrollListener of an onScroll event, since JazzyListView is the primary listener
  * for onScroll events.
  */
 private void notifyAdditionalOnScrollListener(
     AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
   if (mAdditionalOnScrollListener != null) {
     mAdditionalOnScrollListener.onScroll(
         view, firstVisibleItem, visibleItemCount, totalItemCount);
   }
 }
 @Override
 public void onScrollStateChanged(AbsListView view, int scrollState) {
   Log.d(TAG, "scrollState:" + scrollState);
   if (null != mDelegateScrollListener) {
     mDelegateScrollListener.onScrollStateChanged(view, scrollState);
   }
 }
 @Override
 public void onScroll(
     AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
   if (listener != null) {
     listener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
   }
 }
    @Override
    public void onScrollStateChanged(AbsListView view, int scrollState) {
      if (mOnScrollListener != null) {
        mOnScrollListener.onScrollStateChanged(view, scrollState);
      }

      super.onScrollStateChanged(view, scrollState);
    }
 @Override
 public void onScrollStateChanged(AbsListView view, int scrollState) {
   mCalculator.onScrollStateChanged(view, scrollState);
   mCalculator.setScrollDistanceListener(this);
   handleScrollStateChanged(scrollState, SCROLL_STATE_IDLE);
   if (mOnScrollListener != null) {
     mOnScrollListener.onScrollStateChanged(view, scrollState);
   }
 }
 @Override
 public void onScroll(
     AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
   mCalculator.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
   final int scrollState = getScrollState();
   handleScroll(mDy, scrollState, mOldState, SCROLL_STATE_IDLE);
   if (mOnScrollListener != null) {
     mOnScrollListener.onScroll(view, firstVisibleItem, visibleItemCount, totalItemCount);
   }
 }
  public final void onScrollStateChanged(final AbsListView view, final int state) {
    /** Check that the scrolling has stopped, and that the last item is visible. */
    if (state == AbsListView.OnScrollListener.SCROLL_STATE_IDLE
        && null != mOnLastItemVisibleListener
        && mLastItemVisible) {
      mOnLastItemVisibleListener.onLastItemVisible();
    }

    if (null != mOnScrollListener) {
      mOnScrollListener.onScrollStateChanged(view, state);
    }
  }
 @Override
 public void onScrollStateChanged(AbsListView view, int scrollState) {
   // 设置是否滚动的状态
   if (scrollState == AbsListView.OnScrollListener.SCROLL_STATE_IDLE) {
     isScrolling = false;
     this.notifyDataSetChanged();
   } else {
     isScrolling = true;
   }
   if (listener != null) {
     listener.onScrollStateChanged(view, scrollState);
   }
 }
        @Override
        public void onScroll(
            AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
          if (null != mDelegateScrollListener) {
            mDelegateScrollListener.onScroll(
                view, firstVisibleItem, visibleItemCount, totalItemCount);
          }

          int maxStickTop = getPaddingTop();
          int size = mHeaderViews.size();
          int lastVisibleItem = firstVisibleItem + visibleItemCount - 1;
          for (int i = 0; i < size; i++) {
            View v = mHeaderViews.get(i);
            if (!mStickHeaderMap.containsKey(v)) {
              continue;
            }

            StickView stickView = mStickHeaderMap.get(v);
            if (i <= firstVisibleItem) {
              // top the view
              if (v.getTop() != maxStickTop) {
                stickView.top = maxStickTop;
                v.layout(v.getLeft(), maxStickTop, v.getRight(), maxStickTop + v.getHeight());
                Log.d(TAG, "layout stick header " + stickView.position + "to " + maxStickTop);
              }
              maxStickTop += v.getHeight();
            } else if (i > firstVisibleItem && i <= lastVisibleItem) {
              int alignTop =
                  Math.max(stickView.placeHolderView.getTop() + getPaddingTop(), maxStickTop);
              if (v.getTop() != alignTop) {
                stickView.top = alignTop;
                v.layout(v.getLeft(), alignTop, v.getRight(), alignTop + v.getHeight());
                Log.d(TAG, "layout stick header " + stickView.position + "to " + alignTop);
              }
              maxStickTop = alignTop + v.getHeight();
            } else {
              if (v.getTop() != getHeight() - getPaddingBottom()) {
                stickView.top = getHeight() - getPaddingBottom();
                v.layout(v.getLeft(), stickView.top, v.getRight(), stickView.top + v.getHeight());
                Log.d(
                    TAG,
                    "layout stick header " + stickView.position + "to " + stickView.toString());
              }
            }
          }
        }
  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);
    }
  }
 public void onScrollStateChanged(AbsListView abslistview, int i) {
   if (mOnScrollListener != null) {
     mOnScrollListener.onScrollStateChanged(abslistview, i);
   }
 }
示例#13
0
 /**
  * Notifies the OnScrollListener of an onScrollStateChanged event, since JazzyListView is the
  * primary listener for onScrollStateChanged events.
  */
 private void notifyAdditionalOnScrollStateChangedListener(AbsListView view, int scrollState) {
   if (mAdditionalOnScrollListener != null) {
     mAdditionalOnScrollListener.onScrollStateChanged(view, scrollState);
   }
 }