-
- All Implemented Interfaces:
public class MessageSettingsThe class defines the layout and behavior of an in-app message.
These settings are customizable in a Messaging extension message: width: Width of the view in which the message is displayed. Represented in percentage of the total screen width. height: Height of the view in which the message is displayed. Represented in percentage of the total screen height. verticalAlign: Defines the vertical alignment of the message. The alignments can be seen in the MessageAlignment enum. horizontalAlign: Defines the horizontal alignment of the message. The alignments can be seen in the MessageAlignment enum. verticalInset: Defines the vertical inset respective to the verticalAlign. Represented in percentage of the total screen height. horizontalInset: Defines the horizontal inset respective to the horizontalAlign. Represented in percentage of the total screen width. uiTakeover: If true, a displayed message will prevent the user from other UI interactions. displayAnimation: Defines the animation to be used when the message is displayed. The animations can be seen in the MessageAnimation enum. dismissAnimation: Defines the animation to be used when the message is dismissed. The animations can be seen in the MessageAnimation enum. backdropColor: Defines the color of the backdrop shown when a uiTakeover message is displayed. backdropOpacity: Defines the opacity of the backdrop shown when a uiTakeover message is displayed. cornerRadius: Defines the angle to use when rounding the message's webview. gestures: A mapping of gestures and their associated behaviors. The gestures can be seen in the MessageGesture enum. The behavior string is handled by the FullscreenMessageDelegate's overrideUrlLoad function.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumMessageSettings.MessageAlignmentEnum representing Message alignment.
public enumMessageSettings.MessageAnimationEnum representing Message animations.
public enumMessageSettings.MessageGestureEnum representing Message gestures.
-
Field Summary
Fields Modifier and Type Field Description public Objectparentpublic intwidthpublic intheightpublic ObjectverticalAlignpublic ObjecthorizontalAlignpublic intverticalInsetpublic inthorizontalInsetpublic booleanuiTakeoverpublic ObjectdisplayAnimationpublic ObjectdismissAnimationpublic StringbackdropColorpublic floatbackdropOpacitypublic floatcornerRadiuspublic Map<MessageSettings.MessageGesture, String>gestures
-
Method Summary
Modifier and Type Method Description ObjectgetParent()Returns the object that owns the message created using these settings. voidsetParent(Object parent)intgetWidth()Returns the width of the view in which the message is displayed. voidsetWidth(int width)intgetHeight()Returns the height of the view in which the message is displayed. voidsetHeight(int height)Sets the height of the view in which the message is displayed. ObjectgetVerticalAlign()Returns the vertical alignment of the message. voidsetVerticalAlign(Object verticalAlign)Sets the vertical alignment of the message. ObjectgetHorizontalAlign()Returns the horizontal alignment of the message. voidsetHorizontalAlign(Object horizontalAlign)Sets the horizontal alignment of the message. intgetVerticalInset()Returns the vertical inset respective to the vertical alignment. voidsetVerticalInset(int verticalInset)Sets the vertical inset respective to the vertical alignment. intgetHorizontalInset()Returns the horizontal inset respective to the `horizontal alignment. voidsetHorizontalInset(int horizontalInset)Sets the horizontal inset respective to the `horizontal alignment. booleangetUITakeover()Returns a boolean which if true, will prevent the user from other UI interactions if a message is currently displayed. voidsetUiTakeover(boolean uiTakeover)Sets a boolean which if true, will prevent the user from other UI interactions if a message is currently displayed. ObjectgetDisplayAnimation()Returns the animation to be used when the message is displayed. voidsetDisplayAnimation(Object displayAnimation)Sets the animation to be used when the message is displayed. ObjectgetDismissAnimation()Returns the animation to be used when the message is dismissed. voidsetDismissAnimation(Object dismissAnimation)Sets the animation to be used when the message is dismissed. StringgetBackdropColor()Returns the color of the backdrop shown when a uiTakeover message is displayed. voidsetBackdropColor(String backdropColor)Sets the color of the backdrop shown when a uiTakeover message is displayed. floatgetBackdropOpacity()Returns the opacity of the backdrop shown when a uiTakeover message is displayed. voidsetBackdropOpacity(float backdropOpacity)Sets the opacity of the backdrop shown when a uiTakeover message is displayed. floatgetCornerRadius()Returns the angle to use when rounding the message's webview. voidsetCornerRadius(float cornerRadius)Sets the angle to use when rounding the message's webview. Map<MessageSettings.MessageGesture, String>getGestures()Returns a mapping of gestures and their associated behaviors. voidsetGestures(Map<MessageSettings.MessageGesture, String> gestures)Sets a mapping of gestures and their associated behaviors. -
-
Method Detail
-
getWidth
int getWidth()
Returns the width of the view in which the message is displayed. Represented in percentage of the total screen width.
-
setWidth
void setWidth(int width)
-
getHeight
int getHeight()
Returns the height of the view in which the message is displayed. Represented in percentage of the total screen height.
-
setHeight
void setHeight(int height)
Sets the height of the view in which the message is displayed.
- Parameters:
height- Anintcontaining the height of the view in which the message is displayed
-
getVerticalAlign
Object getVerticalAlign()
Returns the vertical alignment of the message. See MessageAlignment.
-
setVerticalAlign
void setVerticalAlign(Object verticalAlign)
Sets the vertical alignment of the message.
- Parameters:
verticalAlign- AMessageAlignmentvalue for the vertical alignment
-
getHorizontalAlign
Object getHorizontalAlign()
Returns the horizontal alignment of the message. See MessageAlignment.
-
setHorizontalAlign
void setHorizontalAlign(Object horizontalAlign)
Sets the horizontal alignment of the message. See MessageAlignment.
- Parameters:
horizontalAlign- AMessageAlignmentvalue for the horizontal alignment
-
getVerticalInset
int getVerticalInset()
Returns the vertical inset respective to the vertical alignment. Represented in percentage of the total screen height.
-
setVerticalInset
void setVerticalInset(int verticalInset)
Sets the vertical inset respective to the vertical alignment. Represented in percentage of the total screen height.
- Parameters:
verticalInset- Anintcontaining the vertical inset percentage
-
getHorizontalInset
int getHorizontalInset()
Returns the horizontal inset respective to the `horizontal alignment. Represented in percentage of the total screen width.
-
setHorizontalInset
void setHorizontalInset(int horizontalInset)
Sets the horizontal inset respective to the `horizontal alignment. Represented in percentage of the total screen width.
- Parameters:
horizontalInset- Anintcontaining the horizontal inset percentage
-
getUITakeover
boolean getUITakeover()
Returns a boolean which if true, will prevent the user from other UI interactions if a message is currently displayed.
-
setUiTakeover
void setUiTakeover(boolean uiTakeover)
Sets a boolean which if true, will prevent the user from other UI interactions if a message is currently displayed.
- Parameters:
uiTakeover- Abooleanvalue which if true, will prevent the user from other UI interactions if a message is currently displayed.
-
getDisplayAnimation
Object getDisplayAnimation()
Returns the animation to be used when the message is displayed. See MessageAnimation.
-
setDisplayAnimation
void setDisplayAnimation(Object displayAnimation)
Sets the animation to be used when the message is displayed. See MessageAnimation.
- Parameters:
displayAnimation- AMessageAnimationvalue for the display animation
-
getDismissAnimation
Object getDismissAnimation()
Returns the animation to be used when the message is dismissed. See MessageAnimation.
-
setDismissAnimation
void setDismissAnimation(Object dismissAnimation)
Sets the animation to be used when the message is dismissed. See MessageAnimation.
- Parameters:
dismissAnimation- AMessageAnimationvalue for the dismiss animation
-
getBackdropColor
String getBackdropColor()
Returns the color of the backdrop shown when a uiTakeover message is displayed.
-
setBackdropColor
void setBackdropColor(String backdropColor)
Sets the color of the backdrop shown when a uiTakeover message is displayed.
- Parameters:
backdropColor- AStringcontaining the HTML hex string color code to use for the backdrop
-
getBackdropOpacity
float getBackdropOpacity()
Returns the opacity of the backdrop shown when a uiTakeover message is displayed.
-
setBackdropOpacity
void setBackdropOpacity(float backdropOpacity)
Sets the opacity of the backdrop shown when a uiTakeover message is displayed.
- Parameters:
backdropOpacity- Afloatcontaining the backdrop opacity percentage with 0.0 being fully transparent and 1.
-
getCornerRadius
float getCornerRadius()
Returns the angle to use when rounding the message's webview.
-
setCornerRadius
void setCornerRadius(float cornerRadius)
Sets the angle to use when rounding the message's webview.
- Parameters:
cornerRadius- Afloatcontaining the corner radius angle to use when rounding the message corners
-
getGestures
Map<MessageSettings.MessageGesture, String> getGestures()
Returns a mapping of gestures and their associated behaviors.
-
setGestures
void setGestures(Map<MessageSettings.MessageGesture, String> gestures)
Sets a mapping of gestures and their associated behaviors.
- Parameters:
gestures- AMap<MessageGesture, Stringcontaining gestures and their associated behaviors
-
-
-
-