android.support.v7.widget.CardView.addView()方法的使用及代码示例

x33g5p2x  于2022-01-18 转载在 其他  
字(3.8k)|赞(0)|评价(0)|浏览(210)

本文整理了Java中android.support.v7.widget.CardView.addView()方法的一些代码示例,展示了CardView.addView()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。CardView.addView()方法的具体详情如下:
包路径:android.support.v7.widget.CardView
类名称:CardView
方法名:addView

CardView.addView介绍

暂无

代码示例

代码示例来源:origin: florent37/MaterialLeanBack

public CellViewHolder(View itemView, int row, MaterialLeanBack.Adapter adapter, MaterialLeanBackSettings settings) {
  super(itemView);
  this.row = row;
  this.adapter = adapter;
  this.settings = settings;
  cardView = (CardView) itemView.findViewById(R.id.cardView);
  this.viewHolder = adapter.onCreateViewHolder(cardView, row);
  this.viewHolder.row = row;
  cardView.addView(viewHolder.itemView);
}

代码示例来源:origin: mylhyl/Android-CircleDialog

protected void buildRootView() {
  CardView cardView = buildCardView();
  buildLinearLayout();
  cardView.addView(mRootCardViewByLinearLayout);
  mRoot = cardView;
}

代码示例来源:origin: KosyanMedia/Aviasales-Android-SDK

public AppodealAdViewHolder(View itemView) {
    super(itemView);
    cardView = (CardView) itemView.findViewById(R.id.cv_results_item);
    View adView = AdsImplKeeper.getInstance().getAdsInterface().getNativeAdView((Activity) itemView.getContext());
    if (adView != null) {
      cardView.addView(adView);
    }
  }
}

代码示例来源:origin: mylhyl/Android-CircleDialog

@Override
protected void buildRootView() {
  LinearLayout rootItem = new LinearLayout(mContext);
  rootItem.setOrientation(LinearLayout.VERTICAL);
  CardView cardView = new CardView(mContext);
  cardView.setCardElevation(0f);
  cardView.setCardBackgroundColor(Color.TRANSPARENT);
  cardView.setRadius(mParams.dialogParams.radius);
  LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(
      ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT, 1);
  //设置列表与按钮之间的下距离
  layoutParams.bottomMargin = mParams.itemsParams.bottomMargin;
  cardView.setLayoutParams(layoutParams);
  rootItem.addView(cardView);
  LinearLayout rootCardViewByLinearLayout = buildLinearLayout();
  cardView.addView(rootCardViewByLinearLayout);
  mRoot = rootItem;
}

代码示例来源:origin: shiburagi/Drawer-Behavior

@Override
public void addView(View child) {
  if (child instanceof NavigationView) {
    super.addView(child);
  } else {
    CardView cardView = new CardView(getContext());
    cardView.setRadius(0);
    cardView.addView(child);
    cardView.setCardElevation(0);
    frameLayout.addView(cardView);
  }
}

代码示例来源:origin: mylhyl/Android-CircleDialog

mItemsView = new BodyRecyclerView(mContext, popupParams, dialogParams);
final View recyclerView = mItemsView.getView();
cardView.addView(recyclerView);

代码示例来源:origin: vipulasri/Artisto_capstone

@Override
  public void onAppInstallAdLoaded(NativeAppInstallAd nativeAppInstallAd) {
    adViewHolder.mNativeAppInstallAdView.setImageView(adViewHolder.mAdImage);
    adViewHolder.mNativeAppInstallAdView.setIconView(adViewHolder.mAdIcon);
    adViewHolder.mNativeAppInstallAdView.setHeadlineView(adViewHolder.mAdHeadline);
    adViewHolder.mNativeAppInstallAdView.setBodyView(adViewHolder.mAdBody);
    adViewHolder.mNativeAppInstallAdView.setCallToActionView(adViewHolder.mAdButton);
    ((TextView) adViewHolder.mNativeAppInstallAdView.getHeadlineView()).setText(nativeAppInstallAd.getHeadline());
    ((TextView) adViewHolder.mNativeAppInstallAdView.getBodyView()).setText(nativeAppInstallAd.getBody());
    ((Button) adViewHolder.mNativeAppInstallAdView.getCallToActionView()).setText(nativeAppInstallAd.getCallToAction());
    ((ImageView) adViewHolder.mNativeAppInstallAdView.getIconView()).setImageDrawable(nativeAppInstallAd.getIcon().getDrawable());
    List<NativeAd.Image> images = nativeAppInstallAd.getImages();
    if (images.size() > 0) {
      ((ImageView) adViewHolder.mNativeAppInstallAdView.getImageView()).setImageDrawable(images.get(0).getDrawable());
    }
    // Assign native ad object to the native view.
    adViewHolder.mNativeAppInstallAdView.setNativeAd(nativeAppInstallAd);
    adViewHolder.mAdParentView.removeAllViews();
    adViewHolder.mAdParentView.addView(adViewHolder.mNativeAppInstallAdView);
  }
});

代码示例来源:origin: zhuanghongji/mp-android-chart

parent.addView(mChart);

相关文章