當前位置: 首頁>>代碼示例>>Java>>正文


Java Adapter.getItemId方法代碼示例

本文整理匯總了Java中android.widget.Adapter.getItemId方法的典型用法代碼示例。如果您正苦於以下問題:Java Adapter.getItemId方法的具體用法?Java Adapter.getItemId怎麽用?Java Adapter.getItemId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.widget.Adapter的用法示例。


在下文中一共展示了Adapter.getItemId方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: rememberSyncState

import android.widget.Adapter; //導入方法依賴的package包/類
void rememberSyncState() {
	if (getChildCount() > 0) {
		this.mNeedSync = true;
		this.mSyncHeight = this.mLayoutHeight;
		View localView;
		if (this.mSelectedPosition >= 0) {
			localView = getChildAt(this.mSelectedPosition - this.mFirstPosition);
			this.mSyncRowId = this.mNextSelectedRowId;
			this.mSyncPosition = this.mNextSelectedPosition;
			if (localView != null)
				this.mSpecificTop = localView.getTop();
			this.mSyncMode = 0;
		} else {
			localView = getChildAt(0);
			Adapter localAdapter = getAdapter();
			if ((this.mFirstPosition >= 0) && (this.mFirstPosition < localAdapter.getCount()))
				this.mSyncRowId = localAdapter.getItemId(this.mFirstPosition);
			else
				this.mSyncRowId = -1L;
			this.mSyncPosition = this.mFirstPosition;
			if (localView != null)
				this.mSpecificTop = localView.getTop();
			this.mSyncMode = 1;
		}
	}
}
 
開發者ID:Evan-Galvin,項目名稱:FreeStreams-TVLauncher,代碼行數:27,代碼來源:AdapterView.java

示例2: findSyncPosition

import android.widget.Adapter; //導入方法依賴的package包/類
int findSyncPosition() {
	int i = this.mItemCount;
	if (i == 0)
		return -1;
	long l1 = this.mSyncRowId;
	int j = this.mSyncPosition;
	if (l1 == -9223372036854775808L)
		return -1;
	j = Math.max(0, j);
	j = Math.min(i - 1, j);
	long l2 = SystemClock.uptimeMillis() + 100L;
	int k = j;
	int m = j;
	int n = 0;
	Adapter localAdapter = getAdapter();
	if (localAdapter == null)
		return -1;
	while (SystemClock.uptimeMillis() <= l2) {
		long l3 = localAdapter.getItemId(j);
		if (l3 == l1)
			return j;
		int i2 = m == i - 1 ? 1 : 0;
		int i1 = k == 0 ? 1 : 0;
		if ((i2 != 0) && (i1 != 0))
			break;
		if ((i1 != 0) || ((n != 0) && (i2 == 0))) {
			m++;
			j = m;
			n = 0;
		} else if ((i2 != 0) || ((n == 0) && (i1 == 0))) {
			k--;
			j = k;
			n = 1;
		}
	}
	return -1;
}
 
開發者ID:Evan-Galvin,項目名稱:FreeStreams-TVLauncher,代碼行數:38,代碼來源:AdapterView.java

示例3: getItemIdAtPosition

import android.widget.Adapter; //導入方法依賴的package包/類
public long getItemIdAtPosition(int paramInt) {
	Adapter localAdapter = getAdapter();
	return (localAdapter == null) || (paramInt < 0) ? -9223372036854775808L : localAdapter.getItemId(paramInt);
}
 
開發者ID:Evan-Galvin,項目名稱:FreeStreams-TVLauncher,代碼行數:5,代碼來源:AdapterView.java


注:本文中的android.widget.Adapter.getItemId方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。