Class NativeAdUnitView

com.yandex.mobile.ads.nativeads

java.lang.Object ⇽ NativeAdUnitView

public class NativeAdUnitView

The class contains a view for all assets of a native ad block.

The view must be set for each mandatory asset, otherwise binding will fail and the ad will not be displayed.

Constructors

NativeAdUnitView(final Context context)

Creates an object of the NativeAdUnitView class programmatically.

NativeAdUnitView(final Context context, final AttributeSet attrs)

Creates an object of the NativeAdUnitView class from an XML file.

NativeAdUnitView(final Context context, final AttributeSet attrs, final int defStyleAttr)

Creates an object of the NativeAdUnitView class from an XML file.

Methods

NativeAdUnitBinder getNativeAd()

Returns a native ad block.

void setSponsoredView(final TextView sponsoredView)

Sets TextView for the advertiser component.

Constructor Detail

NativeAdUnitView

public NativeAdUnitView (final Context context)

Creates an object of the NativeAdUnitView class programmatically.

Parameters:
context

An object of the Context system class.

NativeAdUnitView

public NativeAdUnitView (final Context context, final AttributeSet attrs)

Creates an object of the NativeAdUnitView class from an XML file.

Parameters:
context

An object of the Context system class.

attrs

Attributes that are defined when creating the NativeAdUnitView object via a representation in an XML file.

NativeAdUnitView

public NativeAdUnitView (final Context context, final AttributeSet attrs, final int defStyleAttr)

Creates an object of the NativeAdUnitView class from an XML file.

Parameters:
context

An object of the Context system class.

attrs

Attributes that are defined when creating the NativeAdUnitView object via a representation in an XML file.

defStyleAttr

An attribute that contains a reference to the view resource. The default values are described in the resource.

Method Detail

getNativeAd

public NativeAdUnitBinder getNativeAd ()

Returns a native ad block.

Returns:

A native ad block.

setSponsoredView

public void setSponsoredView (final TextView sponsoredView)

Sets TextView for the advertiser component.

Parameters:
sponsoredView

TextView for the advertiser component.