Class NativeBannerView

com.yandex.mobile.ads.nativeads.template

java.lang.Object ⇽ NativeBannerView

public class NativeBannerView

This class is a template for displaying native ads.

The template appearance (font, background color, margins) is set using the #applyAppearance(NativeTemplateAppearance) method.

Constructors

NativeBannerView(final android.content.Context context)

Constructor for programmatically creating an object of the NativeBannerView class.

NativeBannerView(final android.content.Context context, final android.util.AttributeSet attrs)

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

NativeBannerView(final android.content.Context context, final android.util.AttributeSet attrs, final int defStyleAttr)

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

Methods

void applyAppearance(@Nullable final NativeTemplateAppearance templateAppearance)

Changes the appearance of the native ad template.

void setAd(final NativeGenericAd nativeAd)

Specifies an object of the NativeGenericAd class with the native ad content.

Constructor Detail

NativeBannerView

public NativeBannerView (final android.content.Context context)

Constructor for programmatically creating an object of the NativeBannerView class.

Parameters:
context

An object of the Context system class.

NativeBannerView

public NativeBannerView (final android.content.Context context, final android.util.AttributeSet attrs)

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

Parameters:
context

An object of the Context system class.

attrs

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

NativeBannerView

public NativeBannerView (final android.content.Context context, final android.util.AttributeSet attrs, final int defStyleAttr)

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

Parameters:
context

An object of the Context system class.

attrs

Attributes that are defined when creating the NativeBannerView 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

applyAppearance

public void applyAppearance (@Nullable final NativeTemplateAppearance templateAppearance)

Changes the appearance of the native ad template.

Parameters:
templateAppearance

An object of the NativeTemplateAppearance class.

setAd

public void setAd (final NativeGenericAd nativeAd)

Specifies an object of the NativeGenericAd class with the native ad content.

Parameters:
nativeAd

An object of the NativeGenericAd class.