文档管理中心
我的

BaseAdSlot

展开

Class Info

public class BaseAdSlot

广告位的基类。

Public Constructor Summary

展开

Constructor Name

BaseAdSlot()

广告位基类的构造方法。

Public Method Summary

展开

Qualifier and Type

Method Name and Description

ViewGroup

getContainer()

获取广告位容器。

CreativeMatchStrategy

getCreativeMatchStrategy()

获取广告创意匹配策略。

int

getHeight()

获取广告位的高度。

int

getMaxAdPods()

获取广告荚请求的最大广告数。

int

getOrientation()

获取屏幕方向。

RequestOptions

getRequestOptions()

获取广告请求配置。

String

getSlotId()

获取广告位ID。

int

getTotalDuration()

获取广告播放总时长。

int

getWidth()

获取广告位的宽度。

boolean

isAllowMobileTraffic()

是否允许使用移动流量来预加载广告内容。

void

setAllowMobileTraffic(boolean allowMobileTraffic)

设置是否允许使用移动流量来预加载广告内容。

void

setContainer(ViewGroup container)

设置广告位容器。

void

setCreativeMatchStrategy(CreativeMatchStrategy creativeMatchStrategy)

设置广告创意匹配策略。

void

setMaxAdPods(int maxAdPods)

设置广告荚请求的最大广告数。

void

setOrientation(int orientation)

设置屏幕方向。

void

setRequestOptions(RequestOptions requestOptions)

设置广告请求配置。

void

setSize(int widthSize, int heightSize)

设置广告位宽高。

void

setSlotId(String slotId)

设置广告位ID。

void

setTotalDuration(int totalDuration)

设置广告播放总时长。

Public Methods

getContainer

展开

Method

public ViewGroup getContainer()

获取广告位容器。

Returns

展开

Type

Description

ViewGroup

广告位容器。

getCreativeMatchStrategy

展开

Method

public CreativeMatchStrategy getCreativeMatchStrategy()

获取广告创意匹配策略。

Returns

展开

Name

Description

CreativeMatchStrategy

广告创意匹配策略。

getHeight

展开

Method

public int getHeight()

获取广告位高度。

Returns

展开

Type

Description

int

广告位高度,单位:px。

getMaxAdPods

展开

Method

public int getMaxAdPods()

获取广告荚请求的最大广告数。

Returns

展开

Type

Description

int

广告荚请求的最大广告数。

getOrientation

展开

Method

public int getOrientation()

获取屏幕方向。

Returns

展开

Type

Description

int

屏幕方向:

  • 0:竖屏
  • 1:横屏

getRequestOptions

展开

Method

public RequestOptions getRequestOptions()

获取广告请求配置。

Returns

展开

Type

Description

RequestOptions

广告请求配置。

getSlotId

展开

Method

public String getSlotId()

获取广告位ID。

Returns

展开

Type

Description

String

广告位ID。

getTotalDuration

展开

Method

public int getTotalDuration()

获取广告播放总时长。

Returns

展开

Type

Description

int

广告播放总时长,单位:秒。

getWidth

展开

Method

public int getWidth()

获取广告位宽度。

Returns

展开

Type

Description

int

广告位宽度,单位:px。

isAllowMobileTraffic

展开

Method

public boolean isAllowMobileTraffic()

是否允许使用移动流量来预加载广告内容。

Returns

展开

Type

Description

boolean

是否允许使用移动流量来预加载广告内容:

  • true:是
  • false:否

setAllowMobileTraffic

展开

Method

public void setAllowMobileTraffic(boolean isAllowMobileTraffic)

设置是否允许使用移动流量来预加载广告内容。

Parameters

展开

Name

Description

isAllowMobileTraffic

设置是否允许使用移动流量来预加载广告内容:

  • true:是
  • false:否

setContainer

展开

Method

public void setContainer(ViewGroup container)

设置广告位容器。

Parameters

展开

Name

Description

container

广告位容器。

setCreativeMatchStrategy

展开

Method

public void setCreativeMatchStrategy(CreativeMatchStrategy creativeMatchStrategy)

设置广告创意匹配策略。

Parameters

展开

Name

Description

creativeMatchStrategy

广告创意匹配策略。

setMaxAdPods

展开

Method

public void setMaxAdPods(int maxAdPods)

设置广告荚请求的最大广告数。

Parameters

展开

Name

Description

maxAdPods

广告荚请求的最大广告数。

setOrientation

展开

Method

public void setOrientation(int orientation)

设置屏幕方向。

Parameters

展开

Name

Description

orientation

屏幕方向:

  • 0:竖屏
  • 1:横屏

setRequestOptions

展开

Method

public void setRequestOptions(RequestOptions requestOptions)

设置广告请求配置。

Parameters

展开

Name

Description

requestOptions

广告请求配置。

setSize

展开

Method

public void setSize(int widthSize, int heightSize)

设置广告位的宽高。

Parameters

展开

Name

Description

widthSize

广告位的宽度,单位:px。

heightSize

广告位的高度,单位:px。

setSlotId

展开

Method

public void setSlotId(String slotId)

设置广告位ID。

Parameters

展开

Name

Description

slotId

广告位ID。

setTotalDuration

展开

Method

public void setTotalDuration(int totalDuration)

设置广告播放总时长。

Parameters

展开

Name

Description

totalDuration

广告播放总时长,单位:秒。