本文整理了Java中android.support.v7.widget.CardView.setCardBackgroundColor()
方法的一些代码示例,展示了CardView.setCardBackgroundColor()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CardView.setCardBackgroundColor()
方法的具体详情如下:
包路径:android.support.v7.widget.CardView
类名称:CardView
方法名:setCardBackgroundColor
暂无
代码示例来源:origin: arimorty/floatingsearchview
/**
* Sets the background color of the search
* view including the suggestions section.
*
* @param color the color to be applied to the search bar and
* the suggestion section background.
*/
public void setBackgroundColor(int color) {
mBackgroundColor = color;
if (mQuerySection != null && mSuggestionsList != null) {
mQuerySection.setCardBackgroundColor(color);
mSuggestionsList.setBackgroundColor(color);
}
}
代码示例来源:origin: mancj/MaterialSearchBar
private void setupSearchBarColor() {
searchBarCardView.setCardBackgroundColor(searchBarColor);
setupDividerColor();
}
代码示例来源:origin: jiangqqlmj/FastDev4Android
@Override
public void onBindViewHolder(ItemCardViewHolder holder, int position) {
holder.item_cardview.setCardBackgroundColor(mContext.getResources().getColor(beans.get(position).getColor()));
holder.item_tv.setText(beans.get(position).getTitle());
}
@Override
代码示例来源:origin: wangdan/AisenWeiBo
void setCardViewBackground(JokeBean data) {
int color = themeColorArr[(int) (data.getId() % themeColorArr.length)];
cardView.setCardBackgroundColor(getResources().getColor(color));
}
代码示例来源:origin: flipkart-incubator/proteus
@Override
public void setColor(T view, ColorStateList colors) {
view.setCardBackgroundColor(colors);
}
});
代码示例来源:origin: qingmei2/Samples-Android
/**
* 设置背景色
* @param color
*/
public void setBgColor(int color){
mCardBg.setCardBackgroundColor(color);
}
代码示例来源:origin: thunderpunch/LadderLayoutManager
public void setStrokeColor(int color) {
contentV.setCardBackgroundColor(color);
addV.setCardBackgroundColor(color);
}
}
代码示例来源:origin: jrvansuita/MaterialAbout
public void build(@NonNull AboutBuilder bundle) {
init(bundle);
bind();
setupCard(bundle);
tvName.setText(bundle.getName());
VisibleUtil.handle(tvName, bundle.getName());
tvSubTitle.setText(bundle.getSubTitle());
VisibleUtil.handle(tvSubTitle, bundle.getSubTitle());
tvBrief.setText(bundle.getBrief());
VisibleUtil.handle(tvBrief, bundle.getBrief());
tvAppName.setText(bundle.getAppName());
tvAppTitle.setText(bundle.getAppTitle());
setupBitmaps(bundle);
setupTextColors(bundle);
this.iconColor = bundle.getIconColor();
if (bundle.getBackgroundColor() != 0)
cvHolder.setCardBackgroundColor(bundle.getBackgroundColor());
VisibleUtil.handle(appHolder, bundle.getAppName());
if (appHolder.getVisibility() == VISIBLE)
setDivider(bundle, appHolder);
setDivider(bundle, vLinks);
if (bundle.getLinksColumnsCount() != 0)
vLinks.setColumnCount(bundle.getLinksColumnsCount());
if (bundle.getActionsColumnsCount() != 0)
vActions.setColumnCount(bundle.getActionsColumnsCount());
vLinks.setVisibility(bundle.getLinks().isEmpty() ? GONE : VISIBLE);
vActions.setVisibility(bundle.getActions().isEmpty() ? GONE : VISIBLE);
loadLinks(bundle);
loadActions(bundle);
}
代码示例来源:origin: ypicoleal/LoginDemo
@Override
public void onAnimationUpdate(ValueAnimator animation) {
first_container.setCardBackgroundColor((Integer) animation.getAnimatedValue());
}
});
代码示例来源:origin: ypicoleal/LoginDemo
@Override
public void onAnimationUpdate(ValueAnimator animation) {
first_container.setCardBackgroundColor((Integer) animation.getAnimatedValue());
}
});
代码示例来源:origin: ypicoleal/LoginDemo
@Override
public void onAnimationUpdate(ValueAnimator animation) {
second_container.setCardBackgroundColor((Integer) animation.getAnimatedValue());
}
});
代码示例来源:origin: ypicoleal/LoginDemo
@Override
public void onAnimationUpdate(ValueAnimator animation) {
second_container.setCardBackgroundColor((Integer) animation.getAnimatedValue());
}
});
代码示例来源:origin: arthur-ghazaryan/floating-action-menu
@Override
public boolean onTouch(View v, MotionEvent event) {
if (event.getAction() == MotionEvent.ACTION_DOWN)
((CardView) v).setCardBackgroundColor(Color.parseColor("#ebebeb"));
else if (event.getAction() == MotionEvent.ACTION_UP)
((CardView) v).setCardBackgroundColor(
ContextCompat.getColor(context, R.color.cardview_light_background));
return true;
}
});
代码示例来源:origin: Jerey-Jobs/KeepGank
@Override
public void apply(View view) {
if (view instanceof CardView) {
CardView cardView = (CardView) view;
cardView.setCardBackgroundColor(SkinResourcesUtils.getColor(attrValueRefId));
}
}
}
代码示例来源:origin: jahirfiquitiva/IconShowcase
@Override
public void setCardBackgroundColor(int ignoredColor) {
super.setCardBackgroundColor(ThemeUtils.darkLightOrTransparent(context, R.color
.card_dark_background, R.color.card_light_background, R.color
.card_clear_background));
}
代码示例来源:origin: WangDaYeeeeee/GeometricWeather
@Override
public void onBindView(@NonNull Location location) {
if (location.weather != null) {
card.setCardBackgroundColor(ContextCompat.getColor(context, R.color.colorRoot));
title.setTextColor(weatherView.getThemeColors()[0]);
detailsRecyclerView.setLayoutManager(new LinearLayoutManager(context));
detailsRecyclerView.setAdapter(new DetailsAdapter(context, location.weather));
}
}
}
代码示例来源:origin: materialos/android-icon-pack
public void setBackgroundColor(@ColorInt int color, boolean cache) {
super.setBackgroundColor(color);
ViewGroup parent = (ViewGroup) getParent();
CardView card = (CardView) parent.getParent();
card.setCardBackgroundColor(color);
if (cache && mWallpaper != null)
mWallpaper.setPaletteBgColor(color);
}
}
代码示例来源:origin: qyxxjd/AndroidBasicProject
@Override public void onUpdate(BaseAdapterHelper helper, Demo item, int position) {
final CardView cardView = helper.getView(R.id.main_item_cardview);
cardView.setCardBackgroundColor(item.bgColor);
helper.setText(R.id.main_item_tv, item.title);
}
}
代码示例来源:origin: mylhyl/Android-CircleDialog
protected CardView buildCardView() {
CardView cardView = new CardView(mContext);
cardView.setCardElevation(0f);
cardView.setCardBackgroundColor(Color.TRANSPARENT);
cardView.setRadius(mParams.dialogParams.radius);
return cardView;
}
代码示例来源:origin: ywwynm/EverythingDone
private void initUI() {
TextView tvTitle = f(R.id.tv_title_thing_doing);
tvTitle.setTextColor(mThing.getColor());
mTvASD.setText(mDoingHelper.getAutoStartDoingDesc());
mTvASDTime.setText(mDoingHelper.getAutoDoingTimeDesc());
mTvASM.setText(mDoingHelper.getAutoStrictModeDesc());
enableOrDisableASDTimeUi();
mCvStartAsBt.setCardBackgroundColor(mThing.getColor());
}
内容来源于网络,如有侵权,请联系作者删除!