NativeAdOptions.Builder

class NativeAdOptions.Builder


NativeAdOptions 的构建器类。

摘要

公共构造函数

公共函数

NativeAdOptions!

使用指定的属性构造 NativeAdOptions 对象。

NativeAdOptions.Builder!

将滑动作为自定义点击手势启用。

NativeAdOptions.Builder!

设置“广告选择”图标(如果有)的展示位置。

NativeAdOptions.Builder!

设置媒体宽高比。

NativeAdOptions.Builder!

将此布尔值设置为 true 可请求自定义实现“不再显示该广告”功能。

NativeAdOptions.Builder!

设置是否应请求多张图片。

NativeAdOptions.Builder!

设置是否应仅针对图片素材资源返回网址。

NativeAdOptions.Builder!

设置 VideoOptions 对象。

公共构造函数

构建器

Builder()

公共函数

build

fun build(): NativeAdOptions!

使用指定的属性构造 NativeAdOptions 对象。

enableCustomClickGestureDirection

@CanIgnoreReturnValue
fun enableCustomClickGestureDirection(
    @NativeAdOptions.SwipeGestureDirection swipeGestureDirection: Int,
    tapsAllowed: Boolean
): NativeAdOptions.Builder!

将滑动作为自定义点击手势启用。

参数
@NativeAdOptions.SwipeGestureDirection swipeGestureDirection: Int

要计为一次点击的 SwipeGestureDirection

tapsAllowed: Boolean

是否仍应允许将点按计为点击。

仅适用于列入许可名单的发布商。对于未列入许可名单的发布商,系统会忽略这些设置。

setAdChoicesPlacement

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

设置“广告选择”图标(如果有)的展示位置。该值应为 ADCHOICES_TOP_LEFT、ADCHOICES_TOP_RIGHT、ADCHOICES_BOTTOM_RIGHT 或 ADCHOICES_BOTTOM_LEFT 之一。默认值为 ADCHOICES_TOP_RIGHT。

setMediaAspectRatio

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

设置媒体宽高比。

参数
@NativeAdOptions.NativeMediaAspectRatio aspectRatio: Int

要使用 NativeMediaAspectRatio 选项之一设置的宽高比。

setRequestCustomMuteThisAd

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

将此布尔值设置为 true 可请求自定义实现“不再显示该广告”功能。默认值为 false

setRequestMultipleImages

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

设置是否应请求多张图片。默认值为 false。

setReturnUrlsForImageAssets

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

设置是否应仅针对图片素材资源返回网址。如果为 true,SDK 将不会下载图片素材资源,而是返回仅填充了 URI 和 Scale 属性的 NativeAd.Image。如果为 false,SDK 会自动下载图片素材资源,并返回一个填充了所有三个属性(URI、Scale 和 Drawable)的 NativeAd.Image。默认值为 false。

setVideoOptions

@CanIgnoreReturnValue
fun setVideoOptions(videoOptions: VideoOptions!): NativeAdOptions.Builder!

设置 VideoOptions 对象。