本文整理了Java中android.support.v7.widget.CardView.setTag()
方法的一些代码示例,展示了CardView.setTag()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CardView.setTag()
方法的具体详情如下:
包路径:android.support.v7.widget.CardView
类名称:CardView
方法名:setTag
暂无
代码示例来源:origin: lingochamp/okdownload
@Override public void onClick(View v) {
final boolean started = v.getTag() != null;
if (started) {
controller.stop();
} else {
v.setTag(new Object());
actionTv.setText(R.string.cancel);
// to start
controller.start(serialRb.isChecked());
adapter.notifyDataSetChanged();
serialRb.setEnabled(false);
parallelRb.setEnabled(false);
deleteActionView.setEnabled(false);
deleteActionView.setTag(deleteActionView.getCardElevation());
deleteActionView.setCardElevation(0);
deleteActionTv.setEnabled(false);
}
}
});
代码示例来源:origin: trinhlbk1991/DemoCardViewRecyclerView
@Override
public void onBindViewHolder(ViewHolder viewHolder, int i) {
Movie movie = mItems.get(i);
viewHolder.tvMovie.setText(movie.name);
viewHolder.imgThumbnail.setImageBitmap(movie.imageBitmap);
if (mListener != null) {
viewHolder.cardView.setOnClickListener(this);
viewHolder.cardView.setTag(movie);
}
}
代码示例来源:origin: alexive/visual-goodies
/**
* Build a card given the information you passed by calling all the other methods in this class.
* If you call build and a few other methods after calling build again, the second call will return the card with
* the original settings AND the settings you changed before the second call.
*
* @param context
* @return
*/
public CardView build(Context context) {
CardView mCardView = (CardView) LayoutInflater.from(context).inflate(mCardType.layoutResId, null);
mCardView.setTag(CARD_TYPE_TAG, mCardType);
return build(context, mCardView, true, true, true);
}
代码示例来源:origin: IBM/android-kubernetes-blockchain
@Override
public void onBindViewHolder(ContractListViewHolder holder, int position) {
ContractModel contractModel = contractModels.get(position);
String contractDetails = String.valueOf(contractModel.quantity) + " of " + contractModel.productName;
holder.cancelContractButton.setVisibility(View.GONE);
holder.contractIdFromList.setText(contractModel.getContractId());
holder.contractStateFromList.setText(contractModel.getState());
holder.contractDetails.setText(contractDetails);
holder.contractCard.setTag(contractModel);
holder.contractCard.setOnClickListener(this);
}
代码示例来源:origin: kollerlukas/Camera-Roll-Android-App
private void setColor(CardView card, TextView text, int color) {
if (Color.alpha(color) == 0) {
//color not found
card.setVisibility(View.GONE);
return;
}
card.setCardBackgroundColor(color);
text.setTextColor(getTextColor(text.getContext(), color));
String colorHex = String.format("#%06X", (0xFFFFFF & color));
text.setText(colorHex);
card.setTag(colorHex);
card.setOnClickListener(onClickListener);
}
代码示例来源:origin: Stoick001/SnapchatClone
@Override
public void onBindViewHolder(@NonNull final StoryViewHolders rcViewHolders, int i) {
rcViewHolders.username.setText(usersList.get(i).getUsername());
rcViewHolders.username.setTag(usersList.get(i).getUid());
rcViewHolders.layout.setTag(usersList.get(i).getChatOrStory());
String imageUrl = usersList.get(i).getProfileImageUrl();
if (imageUrl.equals("default")) {
rcViewHolders.profileImage.setImageDrawable(ContextCompat.getDrawable(context, R.drawable.profile));
} else {
rcViewHolders.cardView.setTag(imageUrl);
Glide.with(context).load(imageUrl).into(rcViewHolders.profileImage);
}
}
代码示例来源:origin: Wensibob/GankClient
@Override
public void onBindViewHolder(GankHolder holder, int position) {
Gank gank = gankList.get(position);
holder.cardView.setTag(gank);
if (position == 0) {
showCategeory(true, holder.tvCategeory);
} else {
if (gankList.get(position).type.equals(gankList.get(position - 1).type)) {
showCategeory(false, holder.tvCategeory);
} else {
showCategeory(true,holder.tvCategeory);
}
}
holder.tvCategeory.setText(gank.type);
holder.tv_title.setText(gank.desc);
holder.tv_author.setText(gank.who);
}
代码示例来源:origin: geniusgithub/AndroidDialer
}, mActivityType == ACTIVITY_TYPE_ARCHIVE);
viewHolder.callLogEntryView.setTag(viewHolder);
viewHolder.callLogEntryView.setAccessibilityDelegate(mAccessibilityDelegate);
代码示例来源:origin: shrikanth7698/Custom-Navigation-Drawer
titleTV1.setTextSize(primaryMenuItemTextSize);
final RelativeLayout rootRL = view.findViewById(R.id.rootRL);
backgroundCV.setTag("cv"+i);
System.out.println("Testing "+backgroundCV.getTag());
titleTV.setTag("tv"+i);
代码示例来源:origin: IBM/android-kubernetes-blockchain
String priceConcatenate = String.valueOf(shopItemModel.getPrice()) + " coins each";
holder.cardView.setTag(shopItemModel);
holder.cardView.setOnClickListener(this);
内容来源于网络,如有侵权,请联系作者删除!