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


Java RecyclerView.NO_ID屬性代碼示例

本文整理匯總了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;
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:28,代碼來源:WXListComponent.java

示例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;
}
 
開發者ID:erguotou520,項目名稱:weex-uikit,代碼行數:29,代碼來源:BasicListComponent.java

示例3: getItemId

@Override
public long getItemId(int position) {
    final DataModel m = getItemAt(position);
    if (m == null) {
        return RecyclerView.NO_ID;
    }
    return m.id().hashCode();
}
 
開發者ID:jsaund,項目名稱:RxUploader,代碼行數:8,代碼來源:UploadRecyclerAdapter.java

示例4: onClick

@Override
public void onClick(View v) {
    int index = getAdapterPosition();
    if (onItemClickListener != null && index != RecyclerView.NO_ID) {
        onItemClickListener.onItemClick(adapter.itemAt(index));
    }
}
 
開發者ID:XndroidDev,項目名稱:Xndroid,代碼行數:7,代碼來源:BookmarksFragment.java

示例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;
}
 
開發者ID:erguotou520,項目名稱:weex-uikit,代碼行數:11,代碼來源:BasicListComponent.java

示例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;
}
 
開發者ID:amap-demo,項目名稱:weex-3d-map,代碼行數:11,代碼來源:WXListComponent.java

示例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;
    }
}
 
開發者ID:TakWolf,項目名稱:Android-HeaderAndFooterRecyclerView,代碼行數:8,代碼來源:ProxyAdapter.java

示例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;
    }
}
 
開發者ID:liuyuejinqiu,項目名稱:ScaleViewPager,代碼行數:9,代碼來源:FragmentStatePagerAdapter.java

示例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();
        }
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:13,代碼來源:SingleModalChoiceMode.java

示例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);
    }
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:12,代碼來源:SingleModalChoiceMode.java

示例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);
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:12,代碼來源:SingleChoiceMode.java

示例12: clearChoices

/**
 * {@inheritDoc}
 */
@Override
public void clearChoices() {
    final long itemId = mCheckedId;
    mCheckedId = RecyclerView.NO_ID;
    notifyItemCheckedChanged(itemId, false);
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:9,代碼來源:SingleChoiceMode.java

示例13: getItemId

@Override
public long getItemId(int i) {
  return RecyclerView.NO_ID;
}
 
開發者ID:weiwenqiang,項目名稱:GitHub,代碼行數:4,代碼來源:FlickrPhotoGrid.java

示例14: getCheckedItemCount

/**
 * {@inheritDoc}
 */
@IntRange(from = 0, to = 1)
@Override
public int getCheckedItemCount() {
    return (mCheckedId != RecyclerView.NO_ID ? 1 : 0);
}
 
開發者ID:GlobusLTD,項目名稱:recyclerview-android,代碼行數:8,代碼來源:SingleModalChoiceMode.java

示例15: getItemId

protected long getItemId(@NonNull T bean) {
    return RecyclerView.NO_ID;
}
 
開發者ID:JunhuaLin,項目名稱:MultiTypeAdapter,代碼行數:3,代碼來源:ViewBinder.java


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