NativeAdOptions.Builder

class NativeAdOptions.Builder


Summary

Public constructors

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

Public functions

NativeAdOptions

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

NativeAdOptions.Builder

This function is deprecated. Use com.google.android.gms.ads.nativead.NativeAdOptions instead.

Public constructors

Builder

Builder()

Public functions

build

fun build(): NativeAdOptions

Constructs a NativeAdOptions object with the specified attributes.

setAdChoicesPlacement

@CanIgnoreReturnValue
fun setAdChoicesPlacement(
    @NativeAdOptions.AdChoicesPlacement adChoicesPlacement: Int
): NativeAdOptions.Builder

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
fun setImageOrientation(orientation: Int): NativeAdOptions.Builder

setMediaAspectRatio

@CanIgnoreReturnValue
fun setMediaAspectRatio(
    @NativeAdOptions.NativeMediaAspectRatio aspectRatio: Int
): NativeAdOptions.Builder

setRequestCustomMuteThisAd

@CanIgnoreReturnValue
fun setRequestCustomMuteThisAd(requestCustomMuteThisAd: Boolean): NativeAdOptions.Builder

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

setRequestMultipleImages

@CanIgnoreReturnValue
fun setRequestMultipleImages(shouldRequestMultipleImages: Boolean): NativeAdOptions.Builder

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

setReturnUrlsForImageAssets

@CanIgnoreReturnValue
fun setReturnUrlsForImageAssets(shouldReturnUrls: Boolean): NativeAdOptions.Builder

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
fun setVideoOptions(videoOptions: VideoOptions?): NativeAdOptions.Builder

Sets the VideoOptions object.