NativeAdViewHolder

class NativeAdViewHolder


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

Summary

Public constructors

NativeAdViewHolder(
    containerView: View!,
    clickableAssetViews: (Mutable)Map<String!, View!>!,
    nonclickableAssetViews: (Mutable)Map<String!, View!>!
)

Constructs a NativeAdViewHolder.

Public functions

Unit

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

Unit

Sets the NativeAd that this view holder will show.

Unit

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

Public constructors

NativeAdViewHolder

NativeAdViewHolder(
    containerView: View!,
    clickableAssetViews: (Mutable)Map<String!, View!>!,
    nonclickableAssetViews: (Mutable)Map<String!, View!>!
)

Constructs a NativeAdViewHolder.

Parameters
containerView: View!

A container View for the ad. All views in clickableAssetViews and nonclickableAssetViews must be children of this View.

clickableAssetViews: (Mutable)Map<String!, View!>!

The Map of clickable asset names to corresponding .

nonclickableAssetViews: (Mutable)Map<String!, View!>!

The Map of non-clickable asset names to corresponding View. Pass null if there are no non-clickable Views.

Public functions

setClickConfirmingView

fun setClickConfirmingView(view: View!): Unit

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

Parameters
view: View!

The View to set.

setNativeAd

fun setNativeAd(ad: NativeAd!): Unit

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

Parameters
ad: NativeAd!

The NativeAd that will be associated to the view holder.

unregisterNativeAd

fun unregisterNativeAd(): Unit

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