Package 

Class MessageSettings

  • All Implemented Interfaces:

    
    public class MessageSettings
    
                        

    The 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.

    • Constructor Detail

    • Method Detail

      • getParent

         Object getParent()

        Returns the object that owns the message created using these settings.

      • getWidth

         int getWidth()

        Returns the width of the view in which the message is displayed. Represented in percentage of the total screen 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 - An int containing the height of the view in which the message is displayed
      • setVerticalAlign

         void setVerticalAlign(Object verticalAlign)

        Sets the vertical alignment of the message.

        Parameters:
        verticalAlign - A MessageAlignment value for the vertical alignment
      • setHorizontalAlign

         void setHorizontalAlign(Object horizontalAlign)

        Sets the horizontal alignment of the message. See MessageAlignment.

        Parameters:
        horizontalAlign - A MessageAlignment value 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 - An int containing 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 - An int containing 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 - A boolean value which if true, will prevent the user from other UI interactions if a message is currently displayed.
      • setDisplayAnimation

         void setDisplayAnimation(Object displayAnimation)

        Sets the animation to be used when the message is displayed. See MessageAnimation.

        Parameters:
        displayAnimation - A MessageAnimation value for the display animation
      • setDismissAnimation

         void setDismissAnimation(Object dismissAnimation)

        Sets the animation to be used when the message is dismissed. See MessageAnimation.

        Parameters:
        dismissAnimation - A MessageAnimation value 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 - A String containing 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 - A float containing 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 - A float containing the corner radius angle to use when rounding the message corners