NativeAdViewHolder

public final class NativeAdViewHolder extends Object

View holder for Native Ads which is an alternative way to show Native Ads. Instead of using NativeAdView to show Native Ads, publisher can provide Views owned by the app itself.

Public Constructor Summary

NativeAdViewHolder(View containerView, Map<StringView> clickableAssetViews, Map<StringView> nonclickableAssetViews)
Construct a NativeAdViewHolder.

Public Method Summary

final void
setClickConfirmingView(View view)
Sets the View that users will use to confirm their clickthroughs.
void
setNativeAd(UnifiedNativeAd ad)
Sets the UnifiedNativeAd that this view holder will show.
void
setNativeAd(NativeAd ad)
Sets the NativeAd that this view holder will show.
void
unregisterNativeAd()
Dissociate this view holder from the NativeAd or UnifiedNativeAd it's currently showing.

Inherited Method Summary

Public Constructors

public NativeAdViewHolder (View containerView, Map<StringView> clickableAssetViews, Map<StringView> nonclickableAssetViews)

Construct a NativeAdViewHolder.

Parameters
containerView A container View for the ad. All views in clickableAssetViews and nonclickableAssetViews must be children of this View.
clickableAssetViews The Map of clickable asset names to corresponding View.
nonclickableAssetViews The Map of non-clickable asset names to corresponding View. Pass null if there are no non-clickable Views.

Public Methods

public final void setClickConfirmingView (View view)

Sets the View that users will use to confirm their clickthroughs.

Parameters
view The View to set.

public void setNativeAd (UnifiedNativeAd ad)

Sets the UnifiedNativeAd that this view holder will show. Reset to another UnifiedNativeAd to show a different ad.

Parameters
ad The UnifiedNativeAd that will be shown in this view holder's views.

public void setNativeAd (NativeAd ad)

Sets the NativeAd that this view holder will show. Reset to another NativeAd to show a different ad.

Parameters
ad The NativeAd that will be associated to the view holder.

public void unregisterNativeAd ()

Dissociate this view holder from the NativeAd or UnifiedNativeAd it's currently showing.

发送以下问题的反馈:

此网页
需要帮助?请访问我们的支持页面