public class

ModalDisplayContent

extends Object
implements DisplayContent
java.lang.Object
   ↳ com.urbanairship.iam.modal.ModalDisplayContent

Class Overview

Display content for a TYPE_MODAL in-app message.

Summary

Nested Classes
class ModalDisplayContent.Builder Display Content Builder. 
@interface ModalDisplayContent.Template  
Constants
int MAX_BUTTONS Maximum number of button supported by a modal.
String TEMPLATE_HEADER_BODY_MEDIA Template with display order of header, body, media, buttons, footer.
String TEMPLATE_HEADER_MEDIA_BODY Template with display order of header, media, body, buttons, footer.
String TEMPLATE_MEDIA_HEADER_BODY Template with display order of media, header, body, buttons, footer.
[Expand]
Inherited Constants
From interface com.urbanairship.iam.DisplayContent
Public Methods
boolean equals(Object o)
static ModalDisplayContent fromJson(JsonValue value)
Parses modal display JSON.
int getBackgroundColor()
Returns the background color.
TextInfo getBody()
Returns the optional body TextInfo.
float getBorderRadius()
Returns the border radius in dps.
String getButtonLayout()
Returns the button layout.
List<ButtonInfo> getButtons()
Returns the list of optional buttons.
int getDismissButtonColor()
Returns the dismiss button color.
ButtonInfo getFooter()
Returns the footer button.
TextInfo getHeading()
Returns the optional heading TextInfo.
MediaInfo getMedia()
Returns the optional MediaInfo.
String getTemplate()
Returns the template.
int hashCode()
boolean isFullscreenDisplayAllowed()
Returns true if the modal dialog is allowed to be displayed as fullscreen, otherwise false.
static ModalDisplayContent.Builder newBuilder(ModalDisplayContent displayContent)
Creates a builder from existing display content.
static ModalDisplayContent.Builder newBuilder()
Builder factory method.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.json.JsonSerializable

Constants

public static final int MAX_BUTTONS

Maximum number of button supported by a modal.

Constant Value: 2 (0x00000002)

public static final String TEMPLATE_HEADER_BODY_MEDIA

Template with display order of header, body, media, buttons, footer.

Constant Value: "header_body_media"

public static final String TEMPLATE_HEADER_MEDIA_BODY

Template with display order of header, media, body, buttons, footer.

Constant Value: "header_media_body"

public static final String TEMPLATE_MEDIA_HEADER_BODY

Template with display order of media, header, body, buttons, footer.

Constant Value: "media_header_body"

Public Methods

public boolean equals (Object o)

public static ModalDisplayContent fromJson (JsonValue value)

Parses modal display JSON.

Parameters
value The json payload.
Returns
  • The parsed display content.
Throws
JsonException If the json was unable to be parsed.

public int getBackgroundColor ()

Returns the background color.

Returns
  • The background color.

public TextInfo getBody ()

Returns the optional body TextInfo.

Returns
  • The display body.

public float getBorderRadius ()

Returns the border radius in dps.

Returns
  • Border radius in dps.

public String getButtonLayout ()

Returns the button layout.

Returns
  • The button layout.

public List<ButtonInfo> getButtons ()

Returns the list of optional buttons.

Returns
  • A list of buttons.

public int getDismissButtonColor ()

Returns the dismiss button color.

Returns
  • The dismiss button color.

public ButtonInfo getFooter ()

Returns the footer button.

Returns
  • The footer button.

public TextInfo getHeading ()

Returns the optional heading TextInfo.

Returns
  • The display heading.

public MediaInfo getMedia ()

Returns the optional MediaInfo.

Returns
  • The display media.

public String getTemplate ()

Returns the template.

Returns
  • The template.

public int hashCode ()

public boolean isFullscreenDisplayAllowed ()

Returns true if the modal dialog is allowed to be displayed as fullscreen, otherwise false. See setAllowFullscreenDisplay(boolean)} for more details.

Returns
  • true to allow the modal dialog to display as full screen, otherwise false.

public static ModalDisplayContent.Builder newBuilder (ModalDisplayContent displayContent)

Creates a builder from existing display content.

Parameters
displayContent The display content.
Returns
  • A builder instance.

public static ModalDisplayContent.Builder newBuilder ()

Builder factory method.

Returns
  • A builder instance.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public String toString ()