Code example for AbsListView.OnScrollListener

Methods: onScrollStateChanged

0
	} 
 
	@Override 
	public void onScrollStateChanged(AbsListView view, int scrollState) {
		if (mOnScrollListener != null) {
			mOnScrollListener.onScrollStateChanged(view, scrollState);
		} 
	} 
 
	@Override 
	public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) {
		if (null != mPositionChangedListener && null != mScrollBarPanel) {
 
			// Don't do anything if there is no itemviews 
			if (totalItemCount > 0) {
				/* 
				 * from android source code (ScrollBarDrawable.java) 
				 */ 
				final int thickness = getVerticalScrollbarWidth();
				int height = Math.round((float) getMeasuredHeight() * computeVerticalScrollExtent() / computeVerticalScrollRange());
				int thumbOffset = Math.round((float) (getMeasuredHeight() - height) * computeVerticalScrollOffset() / (computeVerticalScrollRange() - computeVerticalScrollExtent()));