public class AdConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
AdConfig.AdSize |
static interface |
AdConfig.Settings |
Modifier and Type | Field and Description |
---|---|
static int |
APK_DIRECT_DOWNLOAD
When set, the advertisement will support apk direct download feature.
|
static int |
AUTO_ROTATE
When set, the advertisement will auto-rotate to match the device's orientation.
|
static java.lang.String |
FLAG_DIRECT_DOWNLOAD |
static int |
IMMEDIATE_BACK
Allow the user to close the ad immediately after starting it.
|
static int |
IMMERSIVE
Whether or not to use immersive mode.
|
static int |
MUTED
Start this advertisement muted.
|
static int |
TRANSITION_ANIMATE
Apply a fade-in/fade-out animation to the advertisement activity
|
Constructor and Description |
---|
AdConfig() |
Modifier and Type | Method and Description |
---|---|
AdConfig.AdSize |
getAdSize()
Returns AdSize
|
int |
getFlexViewCloseTime()
Gets how long a flexview ad is visible for before it closes automatically.
|
int |
getOrdinal() |
int |
getSettings() |
void |
setAdSize(AdConfig.AdSize adSize)
Sets the AdSize, currently only supported for FlexFeed and MREC ad units
should be called immediately before getNativeAd
|
void |
setAutoRotate(boolean autoRotate)
Sets the orientation of the video ad.
|
void |
setBackButtonImmediatelyEnabled(boolean isBackButtonImmediatelyEnabled)
Sets whether the Android back button will be immediately enabled during the
video ad, or it will be inactive until the on screen close button appears
(the default).
|
void |
setExtraSettings(java.util.Map<java.lang.String,java.lang.Object> extras)
Sets additional flags for ad.
|
void |
setFlexViewCloseTime(int seconds)
Sets how long a flexview ad is visible for before it closes automatically.
|
void |
setImmersiveMode(boolean isImmersiveMode)
Sets whether
immersive mode
will be enabled for KitKat (API level 19) and later devices.
|
void |
setMuted(boolean isMuted)
Sets whether the video should start with its sound matching the
settings of your enclosing application (the default or muted.
|
void |
setOrdinal(int ordinal)
Inlcuding this advertisement, the number of advertisements that have been played
this session.
|
void |
setTransitionAnimationEnabled(boolean isTransitionAnimationEnabled)
Sets whether the video transition animation should be enabled or disabled.
|
public static final java.lang.String FLAG_DIRECT_DOWNLOAD
public static final int MUTED
public static final int IMMEDIATE_BACK
public static final int IMMERSIVE
public static final int TRANSITION_ANIMATE
public static final int AUTO_ROTATE
public static final int APK_DIRECT_DOWNLOAD
public int getSettings()
public void setImmersiveMode(boolean isImmersiveMode)
isImmersiveMode
- true
if immersive mode will be
enabled for KitKat+ devices; otherwise, false
.public int getOrdinal()
public void setOrdinal(int ordinal)
ordinal
- Count in integerspublic void setBackButtonImmediatelyEnabled(boolean isBackButtonImmediatelyEnabled)
Sets whether the Android back button will be immediately enabled during the video ad, or it will be inactive until the on screen close button appears (the default).
Once enabled, the Android back button allows the user to skip the video ad and proceed to the post-roll if one exists; if the ad does not have a post-roll the ad simply ends.
isBackButtonImmediatelyEnabled
- true
if back button should
be enabled before ad close button appears; otherwise, false
public void setAutoRotate(boolean autoRotate)
autoRotate
- if the video ad is supposed to auto-rotate or stick to the setting on Adpublic void setMuted(boolean isMuted)
Sets whether the video should start with its sound matching the settings of your enclosing application (the default or muted.
Note that the user can still manually mute or unmute the sound during playback.
isMuted
- true
if the video should start with its
audio settings matching those of your enclosing application;
false
if it should start muted.public void setTransitionAnimationEnabled(boolean isTransitionAnimationEnabled)
Sets whether the video transition animation should be enabled or disabled. The default is enabled (a fade-in/fade-out animation).
isTransitionAnimationEnabled
- true
if the
video transition animation should be enabled;
false
if it should be disabled.public void setFlexViewCloseTime(int seconds)
seconds
- Value in secondspublic int getFlexViewCloseTime()
public void setExtraSettings(java.util.Map<java.lang.String,java.lang.Object> extras)
extras
- additional configs of ad. Currently we have direct_download flag.public AdConfig.AdSize getAdSize()
public void setAdSize(AdConfig.AdSize adSize)
adSize
-