本文整理匯總了Java中android.support.v7.widget.RecyclerView.NO_ID屬性的典型用法代碼示例。如果您正苦於以下問題:Java RecyclerView.NO_ID屬性的具體用法?Java RecyclerView.NO_ID怎麽用?Java RecyclerView.NO_ID使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類android.support.v7.widget.RecyclerView
的用法示例。
在下文中一共展示了RecyclerView.NO_ID屬性的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: generateViewType
/**
* generate viewtype by component
* @param component
* @return
*/
private int generateViewType(WXComponent component) {
long id;
try {
id = Integer.parseInt(component.getDomObject().getRef());
String type = component.getDomObject().getAttrs().getScope();
if (!TextUtils.isEmpty(type)) {
if (mRefToViewType == null) {
mRefToViewType = new ArrayMap<>();
}
if (!mRefToViewType.containsKey(type)) {
mRefToViewType.put(type, id);
}
id = mRefToViewType.get(type);
}
} catch (RuntimeException e) {
WXLogUtils.eTag(TAG, e);
id = RecyclerView.NO_ID;
WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
}
return (int) id;
}
示例2: generateViewType
/**
* generate viewtype by component
*
* @param component
* @return
*/
private int generateViewType(WXComponent component) {
long id;
try {
id = Integer.parseInt(component.getDomObject().getRef());
String type = component.getDomObject().getAttrs().getScope();
if (!TextUtils.isEmpty(type)) {
if (mRefToViewType == null) {
mRefToViewType = new ArrayMap<>();
}
if (!mRefToViewType.containsKey(type)) {
mRefToViewType.put(type, id);
}
id = mRefToViewType.get(type);
}
} catch (RuntimeException e) {
WXLogUtils.eTag(TAG, e);
id = RecyclerView.NO_ID;
WXLogUtils.e(TAG, "getItemViewType: NO ID, this will crash the whole render system of WXListRecyclerView");
}
return (int) id;
}
示例3: getItemId
@Override
public long getItemId(int position) {
final DataModel m = getItemAt(position);
if (m == null) {
return RecyclerView.NO_ID;
}
return m.id().hashCode();
}
示例4: onClick
@Override
public void onClick(View v) {
int index = getAdapterPosition();
if (onItemClickListener != null && index != RecyclerView.NO_ID) {
onItemClickListener.onItemClick(adapter.itemAt(index));
}
}
示例5: getItemId
@Override
public long getItemId(int position) {
long id;
try {
id = Long.parseLong(getChild(position).getDomObject().getRef());
} catch (RuntimeException e) {
WXLogUtils.e(TAG, WXLogUtils.getStackTrace(e));
id = RecyclerView.NO_ID;
}
return id;
}
示例6: getItemId
@Override
public long getItemId(int position) {
long id;
try {
id = Long.parseLong(getChild(position).getDomObject().getRef());
} catch (RuntimeException e) {
WXLogUtils.e(TAG, WXLogUtils.getStackTrace(e));
id = RecyclerView.NO_ID;
}
return id;
}
示例7: getItemId
@Override
public long getItemId(int position) {
if (adapter != null && !isHeaderViewHolderPosition(position) && !isFooterViewHolderPosition(position)) {
return adapter.getItemId(position - getPositionOffset());
} else {
return RecyclerView.NO_ID;
}
}
示例8: genTagId
protected int genTagId(int position) {
// itemId must not be zero
long itemId = getItemId(position);
if (itemId == RecyclerView.NO_ID) {
return position + 1;
} else {
return (int) itemId;
}
}
示例9: clearChoicesInternal
private void clearChoicesInternal(final boolean fromDestroyCallback) {
final long itemId = mCheckedId;
mCheckedId = RecyclerView.NO_ID;
notifyItemCheckedChanged(itemId, false);
if (!fromDestroyCallback && mActionMode != null) {
if (mFinishActionModeOnClearEnabled) {
mActionMode.finish();
} else {
mActionMode.invalidate();
}
}
}
示例10: registerChoiceModeObserver
/**
* {@inheritDoc}
*/
@Override
public void registerChoiceModeObserver(@NonNull final ChoiceModeObserver observer) {
super.registerChoiceModeObserver(observer);
// Restore action mode when choice mode is registered
if (mCheckedId != RecyclerView.NO_ID) {
startActionMode(false);
}
}
示例11: setItemCheckedInternal
private void setItemCheckedInternal(final long itemId, final boolean checked,
final boolean fromUser) {
final long checkedId = mCheckedId;
mCheckedId = (checked ? itemId : RecyclerView.NO_ID);
if (mChoiceModeListener != null) {
mChoiceModeListener.onItemCheckedStateChanged(itemId, checked, fromUser);
}
notifyItemCheckedChanged(checkedId, fromUser);
notifyItemCheckedChanged(mCheckedId, fromUser);
}
示例12: clearChoices
/**
* {@inheritDoc}
*/
@Override
public void clearChoices() {
final long itemId = mCheckedId;
mCheckedId = RecyclerView.NO_ID;
notifyItemCheckedChanged(itemId, false);
}
示例13: getItemId
@Override
public long getItemId(int i) {
return RecyclerView.NO_ID;
}
示例14: getCheckedItemCount
/**
* {@inheritDoc}
*/
@IntRange(from = 0, to = 1)
@Override
public int getCheckedItemCount() {
return (mCheckedId != RecyclerView.NO_ID ? 1 : 0);
}
示例15: getItemId
protected long getItemId(@NonNull T bean) {
return RecyclerView.NO_ID;
}