当前位置: 首页>>代码示例>>Java>>正文


Java OnScrollListener.SCROLL_STATE_IDLE属性代码示例

本文整理汇总了Java中android.widget.AbsListView.OnScrollListener.SCROLL_STATE_IDLE属性的典型用法代码示例。如果您正苦于以下问题:Java OnScrollListener.SCROLL_STATE_IDLE属性的具体用法?Java OnScrollListener.SCROLL_STATE_IDLE怎么用?Java OnScrollListener.SCROLL_STATE_IDLE使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.widget.AbsListView.OnScrollListener的用法示例。


在下文中一共展示了OnScrollListener.SCROLL_STATE_IDLE属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
	switch (scrollState) {
		case OnScrollListener.SCROLL_STATE_IDLE:
			imageLoader.resume();
			break;
		case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
			if (pauseOnScroll) {
				imageLoader.pause();
			}
			break;
		case OnScrollListener.SCROLL_STATE_FLING:
			if (pauseOnFling) {
				imageLoader.pause();
			}
			break;
	}
	if (externalListener != null) {
		externalListener.onScrollStateChanged(view, scrollState);
	}
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:21,代码来源:PauseOnScrollListener.java

示例2: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    switch (scrollState) {
        case OnScrollListener.SCROLL_STATE_IDLE:
            bitmapUtils.resumeTasks();
            LogUtils.i("当前ListView停止滚动,加载图片开始......................");
            break;
        case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
            if (pauseOnScroll) {
                bitmapUtils.pauseTasks();
                LogUtils.i("当前ListView被触摸滚动,暂停加载......................");
            }
            break;
        case OnScrollListener.SCROLL_STATE_FLING:
            if (pauseOnFling) {
                bitmapUtils.pauseTasks();
                LogUtils.i("当前ListView被手势离开滚动,暂停加载......................");
            }
            break;
    }
    if (externalListener != null) {
        externalListener.onScrollStateChanged(view, scrollState);
    }
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:24,代码来源:PauseOnScrollListener.java

示例3: onScrollStateChanged

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 == OnScrollListener.SCROLL_STATE_IDLE && null != mOnLastItemVisibleListener && mLastItemVisible) {
		if (isLoadAvailable()) {
			setLoadAvailable(false);
			mOnLastItemVisibleListener.onLastItemVisible();
		}
	}

	if (null != mOnScrollListener) {
		mOnScrollListener.onScrollStateChanged(view, state);
	}
}
 
开发者ID:SavorGit,项目名称:Hotspot-master-devp,代码行数:16,代码来源:PullToRefreshAdapterViewBase.java

示例4: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    switch (scrollState) {
        case OnScrollListener.SCROLL_STATE_FLING:
            adapter.lock();
            break;
        case OnScrollListener.SCROLL_STATE_IDLE:
            adapter.unlock();
            break;
        case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
            adapter.lock();
            break;
        default:
            break;
    }
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:16,代码来源:ImageGridActivity.java

示例5: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    switch (scrollState) {
        case OnScrollListener.SCROLL_STATE_IDLE:
            magic.magicEngine.resume();
            break;
        case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
            if (pauseOnScroll) {
                magic.magicEngine.pause();
            }
            break;
        case OnScrollListener.SCROLL_STATE_FLING:
            if (pauseOnFling) {
                magic.magicEngine.pause();
            }
            break;
    }
    if (externalListener != null) {
        externalListener.onScrollStateChanged(view, scrollState);
    }
}
 
开发者ID:redleaf2002,项目名称:magic_imageloader_network,代码行数:21,代码来源:PauseOnScrollListener.java

示例6: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    switch (scrollState) {
        case OnScrollListener.SCROLL_STATE_IDLE:
            taskHandler.resume();
            break;
        case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
            if (pauseOnScroll) {
                taskHandler.pause();
            }
            break;
        case OnScrollListener.SCROLL_STATE_FLING:
            if (pauseOnFling) {
                taskHandler.pause();
            }
            break;
    }
    if (externalListener != null) {
        externalListener.onScrollStateChanged(view, scrollState);
    }
}
 
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:21,代码来源:PauseOnScrollListener.java

示例7: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    if (mScrollListener != null) {
        mScrollListener.onScrollStateChanged(view, scrollState);
    }

    if (scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
        if (mEnableAutoLoad && getLastVisiblePosition() == getCount() - 1) {
            startLoadMore();
        }
    }
}
 
开发者ID:weiwenqiang,项目名称:GitHub,代码行数:12,代码来源:XListView.java

示例8: onScrollStateChanged

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 == OnScrollListener.SCROLL_STATE_IDLE && null != mOnLastItemVisibleListener && mLastItemVisible) {
		mOnLastItemVisibleListener.onLastItemVisible();
	}

	if (null != mOnScrollListener) {
		mOnScrollListener.onScrollStateChanged(view, state);
	}
}
 
开发者ID:ultrasonic,项目名称:ultrasonic,代码行数:13,代码来源:PullToRefreshAdapterViewBase.java

示例9: run

@Override
public void run() {
    mCurrentScrollState = mNewState;
    if (Log.isLoggable(TAG, Log.DEBUG)) {
        Log.d(TAG,
                "new scroll state: " + mNewState + " old state: " + mPreviousScrollState);
    }
    // Fix the position after a scroll or a fling ends
    if (mNewState == OnScrollListener.SCROLL_STATE_IDLE
            && mPreviousScrollState != OnScrollListener.SCROLL_STATE_IDLE
            && mPreviousScrollState != OnScrollListener.SCROLL_STATE_TOUCH_SCROLL) {
        mPreviousScrollState = mNewState;
        int i = 0;
        View child = getChildAt(i);
        while (child != null && child.getBottom() <= 0) {
            child = getChildAt(++i);
        }
        if (child == null) {
            // The view is no longer visible, just return
            return;
        }
        int firstPosition = getFirstVisiblePosition();
        int lastPosition = getLastVisiblePosition();
        boolean scroll = firstPosition != 0 && lastPosition != getCount() - 1;
        final int top = child.getTop();
        final int bottom = child.getBottom();
        final int midpoint = getHeight() / 2;
        if (scroll && top < LIST_TOP_OFFSET) {
            if (bottom > midpoint) {
                smoothScrollBy(top, GOTO_SCROLL_DURATION);
            } else {
                smoothScrollBy(bottom, GOTO_SCROLL_DURATION);
            }
        }
    } else {
        mPreviousScrollState = mNewState;
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:38,代码来源:DayPickerView.java

示例10: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    /******解决abslistview数据不满一屏的时候,会重复加载更多的问题 start ******/
    if (mParent.isStopLoadMore() && scrollState == OnScrollListener.SCROLL_STATE_FLING) {
        isForbidLoadMore = true;
    }
    if (isForbidLoadMore) {
        if (!mParent.isStopLoadMore() && scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
            isForbidLoadMore = false;
        }
        return;
    }
    /******解决abslistview数据不满一屏的时候,会重复加载更多的问题 end ******/
    if (mSilenceLoadMore) {
        if (mRefreshViewListener != null && !hasLoadCompleted() && !mIsLoadingMore && mTotalItemCount - 1 <= view.getLastVisiblePosition() + mPreLoadCount) {
            mRefreshViewListener.onLoadMore(true);
            mIsLoadingMore = true;
        }
    } else if (mContainer != null && !hasLoadCompleted()
            && scrollState == OnScrollListener.SCROLL_STATE_IDLE) {
        if (mPreLoadCount == 0) {
            if (isBottom()) {
                if (!mIsLoadingMore) {
                    mIsLoadingMore = mContainer.invokeLoadMore();
                }
            }
        } else {
            if (mTotalItemCount - 1 <= view.getLastVisiblePosition() + mPreLoadCount) {
                if (!mIsLoadingMore) {
                    mIsLoadingMore = mContainer.invokeLoadMore();
                }
            }
        }
    }
    if (mAbsListViewScrollListener != null) {
        mAbsListViewScrollListener.onScrollStateChanged(view, scrollState);
    }
}
 
开发者ID:LonelyMushroom,项目名称:aarLibrary,代码行数:38,代码来源:XRefreshContentView.java

示例11: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState)
{
	// 滑到底部后自动加载,判断listview已经停止滚动并且最后可视的条目等于adapter的条目
	if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && lastVisibleIndex >= musicOnlineListAdapter.getCount())
	{
           progressBar.setVisibility(View.VISIBLE);
           loadingTip.setVisibility(View.VISIBLE);
           loadVideo();
	}
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:11,代码来源:MusicOnlineListActivity.java

示例12: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState)
{
	// 滑到底部后自动加载,判断listview已经停止滚动并且最后可视的条目等于adapter的条目
	if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && lastVisibleIndex >= videoListAdapter.getCount())
	{
           progressBar.setVisibility(View.VISIBLE);
           loadingTip.setVisibility(View.VISIBLE);
           loadVideo();
	}
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:11,代码来源:SiteDetailActivity.java

示例13: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
	switch (scrollState) {
	case OnScrollListener.SCROLL_STATE_IDLE:
		if (view.getFirstVisiblePosition() == 0 && !isloading && haveMoreData) {
			loadmorePB.setVisibility(View.VISIBLE);
			// sdk初始化加载的聊天记录为20条,到顶时去db里获取更多
			List<EMMessage> messages;
			try {
				// 获取更多messges,调用此方法的时候从db获取的messages
				// sdk会自动存入到此conversation中
				if (chatType == CHATTYPE_SINGLE)
					messages = conversation.loadMoreMsgFromDB(adapter.getItem(0).getMsgId(), pagesize);
				else
					messages = conversation.loadMoreGroupMsgFromDB(adapter.getItem(0).getMsgId(), pagesize);
			} catch (Exception e1) {
				loadmorePB.setVisibility(View.GONE);
				return;
			}
			try {
				Thread.sleep(300);
			} catch (InterruptedException e) {
			}
			if (messages.size() != 0) {
				// 刷新ui
				adapter.notifyDataSetChanged();
				listView.setSelection(messages.size() - 1);
				if (messages.size() != pagesize)
					haveMoreData = false;
			} else {
				haveMoreData = false;
			}
			loadmorePB.setVisibility(View.GONE);
			isloading = false;

		}
		break;
	}
}
 
开发者ID:macyuan,项目名称:TAG,代码行数:39,代码来源:ChatActivity.java

示例14: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    if(OnScrollListener.SCROLL_STATE_IDLE == scrollState){
        isScrolling = false;
        notifyDataSetChanged();
    }
    else{
        isScrolling = true;
    }
    if(outScrollListener != null){
        outScrollListener.onScrollStateChanged(view, scrollState);
    }
}
 
开发者ID:feer921,项目名称:BaseProject,代码行数:13,代码来源:BaseCommonAdapter.java

示例15: onScrollStateChanged

@Override
public void onScrollStateChanged(AbsListView view, int scrollState) {
    if (scrollState == OnScrollListener.SCROLL_STATE_IDLE && view.getLastVisiblePosition() + 1 == view.getCount()) {// 如果滚动到最后一行
        if (onScrollBottomListener != null) {
            onScrollBottomListener.onScorllBootom();
        }
    }
}
 
开发者ID:2402091500,项目名称:CommonPullToRefresh-master,代码行数:8,代码来源:GridViewHandler.java


注:本文中的android.widget.AbsListView.OnScrollListener.SCROLL_STATE_IDLE属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。