public static class

TextInfo.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.iam.TextInfo.Builder

Class Overview

Text info builder.

Summary

Public Methods
TextInfo.Builder addFontFamily(String font)
Adds a font family.
TextInfo.Builder addStyle(String style)
Adds a style.
TextInfo build()
Builds the text info.
TextInfo.Builder setAlignment(String alignment)
Sets the text alignment.
TextInfo.Builder setColor(int color)
Sets the text color.
TextInfo.Builder setDrawable(int drawable)
Sets the drawable to appear next to the text.
TextInfo.Builder setFontSize(float size)
Sets the font size.
TextInfo.Builder setText(String text)
Sets the text.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public TextInfo.Builder addFontFamily (String font)

Adds a font family. The first font family found in the application's font resource directory will be used.

Parameters
font The font family.
Returns
  • The builder instance.

public TextInfo.Builder addStyle (String style)

Adds a style.

Parameters
style The text style.
Returns
  • The builder instance.

public TextInfo build ()

Builds the text info.

Returns
  • The text info.
Throws
IllegalArgumentException If the text and label are missing.

public TextInfo.Builder setAlignment (String alignment)

Sets the text alignment.

Parameters
alignment The text alignment.
Returns
  • The builder instance.

public TextInfo.Builder setColor (int color)

Sets the text color. Defaults to black.

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

public TextInfo.Builder setDrawable (int drawable)

Sets the drawable to appear next to the text.

Parameters
drawable The drawable resource ID.
Returns
  • The builder instance.

public TextInfo.Builder setFontSize (float size)

Sets the font size. Defaults to 14sp.

Parameters
size The font size.
Returns
  • The builder instance.

public TextInfo.Builder setText (String text)

Sets the text.

Parameters
text The text.
Returns
  • The builder instance.