Class NativeContentAdView

com.yandex.mobile.ads.nativeads

java.lang.Object ⇽ NativeContentAdView

public class NativeContentAdView

The class contains a view for all assets of an ad in the Content format.

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

Constructors

NativeContentAdView(final Context context)

Creates an object of the NativeContentAdView class programmatically.

NativeContentAdView(final Context context, final AttributeSet attrs)

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

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

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

Methods

NativeContentAdBinder getNativeAd()

Returns native ads in the Content format.

void setAgeView(final TextView ageView)

Sets the TextView for the age component.

void setBodyView(final TextView bodyView)

Sets TextView for the main text of an ad.

void setCallToActionView(final Button callToActionView)

Sets Button for a call-to-action button.

void setDomainView(final TextView domainView)

Sets TextView for the domain component.

void setFeedbackView(final Button feedbackView)

Sets Button for handling the reasons for closing the ad.

void setIconView(final ImageView iconView)

Sets ImageView for the app icon.

void setImageView(final ImageView imageView)

Sets ImageView for the main image of an ad.

void setMediaView(final MediaView mediaView)

Sets MediaView for displaying the media content.

void setSponsoredView(final TextView sponsoredView)

Sets TextView for the advertiser component.

void setTitleView(final TextView titleView)

Sets the TextView for the title of an ad.

void setWarningView(final TextView warningView)

Sets TextView for a warning.

Constructor Detail

NativeContentAdView

public NativeContentAdView (final Context context)

Creates an object of the NativeContentAdView class programmatically.

Parameters:
context

An object of the Context system class.

NativeContentAdView

public NativeContentAdView (final Context context, final AttributeSet attrs)

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

Parameters:
context

An object of the Context system class.

attrs

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

NativeContentAdView

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

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

Parameters:
context

An object of the Context system class.

attrs

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

defStyleAttr

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

Method Detail

getNativeAd

public NativeContentAdBinder getNativeAd ()

Returns native ads in the Content format.

Returns:

Native ads in the Content format.

setAgeView

public void setAgeView (final TextView ageView)

Sets the TextView for the age component.

Parameters:
ageView

TextView for the age component.

setBodyView

public void setBodyView (final TextView bodyView)

Sets TextView for the main text of an ad.

Parameters:
bodyView

TextView for the main text of an ad.

setCallToActionView

public void setCallToActionView (final Button callToActionView)

Sets Button for a call-to-action button.

Parameters:
callToActionView

Button for a call-to-action button.

setDomainView

public void setDomainView (final TextView domainView)

Sets TextView for the domain component.

Parameters:
domainView

TextView for the domain component.

setFeedbackView

public void setFeedbackView (final Button feedbackView)

Sets Button for handling the reasons for closing the ad.

Parameters:
feedbackView

Button for handling the reasons for closing the ad.

setIconView

public void setIconView (final ImageView iconView)

Sets ImageView for the app icon.

Parameters:
iconView

ImageView for the app icon.

setImageView

public void setImageView (final ImageView imageView)

Sets ImageView for the main image of an ad.

Parameters:
imageView

ImageView for the main image of an ad.

Note.

This method is deprecated. Use the new method: #setMediaView(MediaView).

setMediaView

public void setMediaView (final MediaView mediaView)

Sets MediaView for displaying the media content.

Parameters:
mediaView

MediaView for displaying the media content.

setSponsoredView

public void setSponsoredView (final TextView sponsoredView)

Sets TextView for the advertiser component.

Parameters:
sponsoredView

TextView for the advertiser component.

setTitleView

public void setTitleView (final TextView titleView)

Sets the TextView for the title of an ad.

Parameters:
titleView

TextView for the title of an ad.

setWarningView

public void setWarningView (final TextView warningView)

Sets TextView for a warning.

Parameters:
warningView

TextView for the warning.