Class Info |
|---|
public static final class NativeAdConfiguration.Builder extends Object Builder for native ad configuration. |
Qualifier and Type | Method Name and Description |
|---|---|
build() Constructs an ad configuration object. | |
NativeAdConfiguration.Builder | Sets the dimensions of the requested ad. |
NativeAdConfiguration.Builder | setChoicesPosition(int choicesPosition) Sets the ad choice icon position. |
NativeAdConfiguration.Builder | setMediaAspect(int aspect) Sets the aspect ratio of an ad image. |
NativeAdConfiguration.Builder | setMediaDirection(int direction) Sets the orientation of an ad image. |
NativeAdConfiguration.Builder | setRequestCustomDislikeThisAd(boolean requestCustomDislikeThisAd) Sets whether to customize the function of closing the ad. |
NativeAdConfiguration.Builder | setRequestMultiImages(boolean requestMultiImages) Sets whether to request multiple ad images. |
NativeAdConfiguration.Builder | setReturnUrlsForImages(boolean returnUrls) Sets whether to allow the SDK to download native ad images. |
NativeAdConfiguration.Builder | setVideoConfiguration(VideoConfiguration videoOptions) Sets the information about a native video. |
Method |
|---|
public final NativeAdConfiguration build() Constructs an ad configuration object. |
Returns
Type | Description |
|---|---|
Ad configuration object. |
Method |
|---|
public final NativeAdConfiguration.Builder setAdSize(AdSize AdSize) Sets the dimensions of the requested ad. |
Parameters
Name | Description |
|---|---|
adSize | Ad dimensions. |
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setChoicesPosition(int choicesPosition) Sets the ad choice icon position. |
Parameters
Name | Description |
|---|---|
choicesPosition | Ad choice icon position. For details, please refer to com.huawei.hms.ads.nativead.NativeAdConfiguration.ChoicesPosition. |
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setMediaAspect(int aspect) Sets the aspect ratio of an ad image. |
Parameters
Name | Description |
|---|---|
aspect | Aspect ratio of an ad image. For details, please refer to com.huawei.hms.ads.nativead.NativeAdConfiguration.MediaAspect. |
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setMediaDirection(int direction) Sets the orientation of an ad image. |
Parameters
Name | Description |
|---|---|
direction | Orientation of an ad image. For details, please refer to com.huawei.hms.ads.nativead.NativeAdConfiguration.Direction. |
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setRequestCustomDislikeThisAd(boolean requestCustomDislikeThisAd) Sets whether to customize the function of closing the ad. |
Parameters
Name | Description |
|---|---|
requestCustomDislikeThisAd | Indicates whether to customize the function of closing the ad.
|
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setRequestMultiImages(boolean requestMultiImages) Sets whether to request multiple ad images. |
Parameters
Name | Description |
|---|---|
requestMultiImages | Indicates whether to request multiple ad images.
|
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setReturnUrlsForImages(boolean returnUrls) Sets whether to allow the SDK to download native ad images. |
Parameters
Name | Description |
|---|---|
returnUrls | Indicates whether to allow the SDK to download native ad images.
|
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |
Method |
|---|
public final NativeAdConfiguration.Builder setVideoConfiguration(VideoConfiguration videoOptions) Sets the information about a native video. |
Parameters
Name | Description |
|---|---|
videoOptions | Information about a native video. |
Returns
Type | Description |
|---|---|
NativeAdConfiguration.Builder | A NativeAdConfiguration.Builder object. |