public static class

HtmlDisplayContent.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.iam.html.HtmlDisplayContent.Builder

Class Overview

Display Content Builder.

Summary

Public Methods
HtmlDisplayContent build()
Builds the HTML display content.
HtmlDisplayContent.Builder setAllowFullscreenDisplay(boolean isFullscreenDisplayAllowed)
Enables the message to display as fullscreen.
HtmlDisplayContent.Builder setBackgroundColor(int color)
Sets the background color.
HtmlDisplayContent.Builder setBorderRadius(float borderRadius)
Sets the border radius in dps.
HtmlDisplayContent.Builder setDismissButtonColor(int color)
Sets the dismiss button color.
HtmlDisplayContent.Builder setRequireConnectivity(boolean requireConnectivity)
Sets whether the message should check connectivity before displaying.
HtmlDisplayContent.Builder setSize(int width, int height, boolean keepAspectRatio)
Sets the size constraint for the display content when displaying the HTML message as a dialog.
HtmlDisplayContent.Builder setUrl(String url)
Sets the message's URL.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public HtmlDisplayContent build ()

Builds the HTML display content.

Returns
  • The HTML display content.
Throws
IllegalArgumentException If the URL is missing.

public HtmlDisplayContent.Builder setAllowFullscreenDisplay (boolean isFullscreenDisplayAllowed)

Enables the message to display as fullscreen. The message will display as fullscreen if enabled and and the bool resource `ua_iam_html_allow_fullscreen_display` is true. `ua_iam_html_allow_fullscreen_display` defaults to true when the screen width is less than 480dps.

Parameters
isFullscreenDisplayAllowed true to allow displaying the iam as fullscreen, otherwise false.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setBackgroundColor (int color)

Sets the background color. Defaults to white.

Parameters
color The background color.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setBorderRadius (float borderRadius)

Sets the border radius in dps. Defaults to 0.

Parameters
borderRadius The border radius.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setDismissButtonColor (int color)

Sets the dismiss button color. Defaults to black.

Parameters
color The dismiss button color.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setRequireConnectivity (boolean requireConnectivity)

Sets whether the message should check connectivity before displaying.

Parameters
requireConnectivity true to require connectivity, otherwise false.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setSize (int width, int height, boolean keepAspectRatio)

Sets the size constraint for the display content when displaying the HTML message as a dialog.

Parameters
width The width. Use 0 for fill.
height The height. Use 0 for fill.
keepAspectRatio If the aspect ratio should be kept if the width or height are larger than the screen.
Returns
  • The builder instance.

public HtmlDisplayContent.Builder setUrl (String url)

Sets the message's URL.

Parameters
url The message's URL.
Returns
  • The builder instance.