public final class InAppConfiguration
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static android.os.Parcelable.Creator<InAppConfiguration> |
CREATOR |
static float |
DEFAULT_VIDEO_CONVERSION_PERCENTAGE |
protected static java.util.regex.Pattern |
FILE_META_TAG_REGEX |
protected com.localytics.android.MarketingLogger |
logger |
protected float |
videoConversionPercentage |
Modifier and Type | Method and Description |
---|---|
int |
describeContents() |
protected java.lang.String[] |
getKeyValueConfigurationForCreative(java.lang.String filePath)
Get key value pairs for injecting into the creative campaign
|
float |
getVideoConversionPercentage() |
protected void |
handleKeyValuePairs(java.lang.String[] pairs) |
boolean |
isBottomBannerCampaign()
Get whether the in-app will be presented as a bottom banner campaign.
|
boolean |
isCenterCampaign()
Get whether the in-app will be presented as a center campaign.
|
boolean |
isFullScreenCampaign()
Get whether the in-app will be presented as a full screen campaign.
|
boolean |
isTopBannerCampaign()
Get whether the in-app will be presented as a top banner campaign.
|
void |
setAspectRatio(float aspectRatio)
Set the aspect ratio for this in-app.
|
void |
setBackgroundAlpha(float backgroundAlpha)
Set the background alpha for this in-app.
|
void |
setBannerOffsetDps(int offsetDps)
Set the offset for this in-app.
|
void |
setDismissButtonImage(android.content.res.Resources resources,
android.graphics.Bitmap image)
Set the dismiss button image for this in-app.
|
void |
setDismissButtonImage(android.content.res.Resources resources,
int id)
Set the dismiss button image for this in-app.
|
void |
setDismissButtonLocation(Localytics.InAppMessageDismissButtonLocation dismissButtonLocation)
Set the dismiss button location for this in-app.
|
void |
setDismissButtonVisibility(int visibility)
Set the dismiss button image for this in-app.
|
void |
setShouldRenderInNotch(boolean renderInNotch) |
void |
setVideoConversionPercentage(float percent)
Sets what percentage of the total duration of the video to fire the "Localytics Video Played" event.
|
protected void |
updateValuesWithContentsOfCreative(WebViewCampaign c) |
void |
writeToParcel(android.os.Parcel dest,
int flags) |
public static final android.os.Parcelable.Creator<InAppConfiguration> CREATOR
public static final float DEFAULT_VIDEO_CONVERSION_PERCENTAGE
protected static java.util.regex.Pattern FILE_META_TAG_REGEX
protected com.localytics.android.MarketingLogger logger
protected float videoConversionPercentage
public boolean isCenterCampaign()
public boolean isTopBannerCampaign()
public boolean isBottomBannerCampaign()
public boolean isFullScreenCampaign()
public void setAspectRatio(float aspectRatio)
Accepted values must be greater than 0.
This property is only relevant for center in-app Campaigns
aspectRatio
- a float value greater than 0 representing the aspect ratio of the campaign.public void setBackgroundAlpha(float backgroundAlpha)
Accepted values must be greater than 0 and less than 1.
This property is only relevant for center and full screen in-app Campaigns
backgroundAlpha
- a float value greater than 0 and less than 1
representing the transparency of the campaign backdrop.public void setBannerOffsetDps(int offsetDps)
This property is only relevant for banner in-app Campaigns
offsetDps
- an int value representing the offset from the edge of the screen.public void setDismissButtonLocation(Localytics.InAppMessageDismissButtonLocation dismissButtonLocation)
Localytics.setInAppMessageDismissButtonLocation(com.localytics.android.Localytics.InAppMessageDismissButtonLocation)
.dismissButtonLocation
- Either InAppMessageDismissButtonLocation.LEFT or InAppMessageDismissButtonLocation.RIGHTpublic void setDismissButtonImage(@NonNull android.content.res.Resources resources, @DrawableRes int id)
Localytics.setInAppMessageDismissButtonImage(Resources, int)
or
Localytics.setInAppMessageDismissButtonImage(Resources, Bitmap)
.resources
- The Resources instance for your application's package.id
- The image resource id for the close button appearance.public void setDismissButtonImage(@NonNull android.content.res.Resources resources, @Nullable android.graphics.Bitmap image)
Localytics.setInAppMessageDismissButtonImage(Resources, int)
or
Localytics.setInAppMessageDismissButtonImage(Resources, Bitmap)
.resources
- The Resources instance for your application's package.image
- The bitmap object for the close button appearance.public void setDismissButtonVisibility(int visibility)
Localytics.setInAppMessageDismissButtonVisibility(int)
.visibility
- The visibility state of the dismiss buttonView.setVisibility(int)
public void setShouldRenderInNotch(boolean renderInNotch)
public int describeContents()
public void writeToParcel(@NonNull android.os.Parcel dest, int flags)
writeToParcel
in interface android.os.Parcelable
protected void updateValuesWithContentsOfCreative(WebViewCampaign c)
protected void handleKeyValuePairs(java.lang.String[] pairs)
protected java.lang.String[] getKeyValueConfigurationForCreative(java.lang.String filePath)
filePath
- The path to the creativepublic void setVideoConversionPercentage(float percent)
percent
- The percentage of the videopublic float getVideoConversionPercentage()