本文整理汇总了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;
}
}
}
示例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;
}
示例3: getItemIdAtPosition
import android.widget.Adapter; //导入方法依赖的package包/类
public long getItemIdAtPosition(int paramInt) {
Adapter localAdapter = getAdapter();
return (localAdapter == null) || (paramInt < 0) ? -9223372036854775808L : localAdapter.getItemId(paramInt);
}