NativeAdViewHolder

public final classNativeAdViewHolderextendsObject

View holder for native ads which is an alternative way to show native ads. Instead of usingNativeAdView to show native ads, publishers can provide Views owned by the app itself.

Public Constructor Summary

NativeAdViewHolder(View containerView,Map<String,View> clickableAssetViews,Map<String,View> nonclickableAssetViews)
Constructs a NativeAdViewHolder.

Public Method Summary

void
setClickConfirmingView(Viewview)
Sets theViewthat users will use to confirm their clickthroughs.
void
setNativeAd(NativeAd ad)
Sets theNativeAd that this view holder will show.
void
unregisterNativeAd()
Dissociate this view holder from theNativeAd it's currently showing.

Inherited Method Summary

Public Constructors

publicNativeAdViewHolder(ViewcontainerView,Map<String,View> clickableAssetViews,Map<String,View> nonclickableAssetViews)

Constructs aNativeAdViewHolder.

Parameters
containerView A containerViewfor the ad. All views in clickableAssetViews and nonclickableAssetViews must be children of this View.
clickableAssetViews TheMapof clickable asset names to correspondingView.
nonclickableAssetViews TheMapof non-clickable asset names to correspondingView.Pass nullif there are no non-clickableViews.

Public Methods

public voidsetClickConfirmingView(Viewview)

Sets theViewthat users will use to confirm their clickthroughs.

Parameters
view TheViewto set.

public voidsetNativeAd(NativeAd ad)

Sets theNativeAd that this view holder will show. Reset to anotherNativeAd to show a different ad.

Parameters
ad TheNativeAd that will be associated to the view holder.

public voidunregisterNativeAd()

Dissociate this view holder from theNativeAd it's currently showing.