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


Java OnScrollListener.SCROLL_STATE_TOUCH_SCROLL属性代码示例

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


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

@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

示例4: 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

示例5: getScrollStateString

private String getScrollStateString(int flag) {
	String str = "";
	switch (flag) {
	case OnScrollListener.SCROLL_STATE_IDLE:
		str = "SCROLL_STATE_IDLE";
		break;
	case OnScrollListener.SCROLL_STATE_TOUCH_SCROLL:
		str = "SCROLL_STATE_TOUCH_SCROLL";
		break;
	case OnScrollListener.SCROLL_STATE_FLING:
		str = "SCROLL_STATE_FLING";
		break;
	default:
		str = "wrong state";
	}

	return str;
}
 
开发者ID:BigAppOS,项目名称:BigApp_Discuz_Android,代码行数:18,代码来源:ReboundListView1.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: 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

示例8: shouldDelay

public static boolean shouldDelay(int groupPosition, int childPosition, View convertView, ViewGroup parent, String url)
{
	if (url == null || BitmapAjaxCallback.isMemoryCached(url))
	{
		return false;
	}
	AbsListView lv = (AbsListView) parent;
	OnScrollListener sl = (OnScrollListener) parent.getTag(AQuery.TAG_SCROLL_LISTENER);
	if (sl == null)
	{
		sl = new Common();
		lv.setOnScrollListener(sl);
		parent.setTag(AQuery.TAG_SCROLL_LISTENER, sl);
	}
	Integer scrollState = (Integer) lv.getTag(AQuery.TAG_NUM);
	if (scrollState == null || scrollState == OnScrollListener.SCROLL_STATE_IDLE || scrollState == OnScrollListener.SCROLL_STATE_TOUCH_SCROLL)
	{
		return false;
	}
	long packed = childPosition;
	if (parent instanceof ExpandableListView)
	{
		packed = ExpandableListView.getPackedPositionForChild(groupPosition, childPosition);
	}
	convertView.setTag(AQuery.TAG_NUM, packed);
	//TODO add draw count and skip drawing list if possible
	return true;
}
 
开发者ID:libit,项目名称:lr_dialer,代码行数:28,代码来源:Common.java


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