Class BannerAppearance.Builder

com.yandex.mobile.ads.nativeads.template.appearance

public  class  BannerAppearance.Builder 

A class for changing the default ad appearance.

Methods

Builder()

Creates an object of the BannerAppearance.Builder class.

BannerAppearance build()

Creates an object of the BannerAppearance class using the default ad appearance.

BannerAppearance.Builder setBackgroundColor(final int backgroundColor)

Sets the background color of the ad.

BannerAppearance.Builder setBorderColor(final int borderColor)

Specifies the color of an ad's border.

BannerAppearance.Builder setBorderWidth(final float borderWidth)

Sets the width of the ad border.

BannerAppearance.Builder setContentPadding(final HorizontalOffset contentPadding)

Sets the horizontal margins from the content to the edges of the ad.

BannerAppearance.Builder setImageMargins(final HorizontalOffset imageMargins)

Sets the horizontal margins from the image to the ad content.

Method Detail

Builder

public Builder ()

Creates an object of the BannerAppearance.Builder class.

build

public BannerAppearance build ()

Creates an object of the BannerAppearance class using the default ad appearance.

Returns:

An object of the BannerAppearance class with the default ad appearance.

setBackgroundColor

public BannerAppearance.Builder setBackgroundColor (final int backgroundColor)

Sets the background color of the ad.

Parameters:
backgroundColor

The background color of the ad.

Returns:

Returns an object of the BannerAppearance.Builder class with the specified background color.

setBorderColor

public BannerAppearance.Builder setBorderColor (final int borderColor)

Specifies the color of an ad's border.

Parameters:
borderColor

Ad border color.

Returns:

Returns an object of the BannerAppearance.Builder class with the specified border color.

setBorderWidth

public BannerAppearance.Builder setBorderWidth (final float borderWidth)

Sets the width of the ad border.

Parameters:
borderWidth

The width of the ad border.

Returns:

Returns an object of the BannerAppearance.Builder class with the specified border width.

setContentPadding

public BannerAppearance.Builder setContentPadding (final HorizontalOffset contentPadding)

Sets the horizontal margins from the content to the edges of the ad.

Parameters:
contentPadding

Horizontal (left and right) content margins.

Returns:

Returns an object of the BannerAppearance.Builder class with the set horizontal margins.

setImageMargins

public BannerAppearance.Builder setImageMargins (final HorizontalOffset imageMargins)

Sets the horizontal margins from the image to the ad content.

The left margin is relative to the left edge of the content. The right margin is the gap between the right edge of the image and the left edge of the text.
Note.

The imageMargins parameter does not apply to large images that are under the main ad text and cover the entire width of this ad.

Parameters:
imageMargins

Horizontal (left and right) image margins.

Returns:

Returns an object of the BannerAppearance.Builder class with the set horizontal margins of the image.