NativeAdOptions.Builder

public final class NativeAdOptions.Builder


Summary

Public constructors

Public methods

final @NonNull NativeAdOptions

Constructs a NativeAdOptions object with the specified attributes.

final @NonNull NativeAdOptions.Builder

Sets the placement of AdChoices icon (if present).

final @NonNull NativeAdOptions.Builder
final @NonNull NativeAdOptions.Builder
final @NonNull NativeAdOptions.Builder
@CanIgnoreReturnValue
setRequestCustomMuteThisAd(boolean requestCustomMuteThisAd)

Set this boolean to true to request a custom implementation for the Mute This Ad feature.

final @NonNull NativeAdOptions.Builder
@CanIgnoreReturnValue
setRequestMultipleImages(boolean shouldRequestMultipleImages)

Sets whether multiple images should be requested or not.

final @NonNull NativeAdOptions.Builder

Sets whether URLs alone should be returned for image assets.

final @NonNull NativeAdOptions.Builder

Sets the VideoOptions object.

Public constructors

Builder

public Builder()

Public methods

build

public final @NonNull NativeAdOptions build()

Constructs a NativeAdOptions object with the specified attributes.

setAdChoicesPlacement

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setAdChoicesPlacement(
    @NativeAdOptions.AdChoicesPlacement int adChoicesPlacement
)

Sets the placement of AdChoices icon (if present). The value should be one of ADCHOICES_TOP_LEFT, ADCHOICES_TOP_RIGHT, ADCHOICES_BOTTOM_RIGHT or ADCHOICES_BOTTOM_LEFT. The default value is ADCHOICES_TOP_RIGHT.

setImageOrientation

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setImageOrientation(int orientation)

setRequestCustomMuteThisAd

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setRequestCustomMuteThisAd(boolean requestCustomMuteThisAd)

Set this boolean to true to request a custom implementation for the Mute This Ad feature. Default value is false.

setRequestMultipleImages

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setRequestMultipleImages(boolean shouldRequestMultipleImages)

Sets whether multiple images should be requested or not. Default value is false.

setReturnUrlsForImageAssets

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setReturnUrlsForImageAssets(boolean shouldReturnUrls)

Sets whether URLs alone should be returned for image assets. If true, the SDK will not download image assets and instead return a NativeAd.Image with just the URI and Scale properties populated. If false, the SDK will automatically download image assets and return a NativeAd.Image with all three properties (URI, Scale, and Drawable) populated. The default value is false.

setVideoOptions

@CanIgnoreReturnValue
public final @NonNull NativeAdOptions.Builder setVideoOptions(VideoOptions videoOptions)

Sets the VideoOptions object.