當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。