class TextBlock


A block of text with up to three different TextType of text lines that are displayed by the text index order (for example, text1 is displayed first) by design. The block also has a priority number relative to other blocks such as an ImageBlock.

Priority is a number assigned to blocks to show the semantic importance of each block in a sequence. Different templates will interpret priority in different ways. Some may treat this as an ordering, some may only use it to define which elements are most important when showing smaller layouts. Priority number is zero based with smaller numbers being higher priority. If two blocks has the same priority number, the default order (e.g. text before image) is used. Currently only TextBlock and ImageBlock comparison are supported in the design. For example, the Gallery Template layout determines the ordering of mainTextBlock and mainImageBlock in GalleryTemplateData by their corresponding priority number.

Summary

Public constructors

TextBlock(
    text1: TemplateText,
    text2: TemplateText?,
    text3: TemplateText?,
    priority: @IntRange(from = 0) Int
)

Public functions

open operator Boolean
equals(other: Any?)
open Int

Public properties

Int

The display priority number relative to other blocks.

TemplateText

The text displayed first within the block.

TemplateText?

The text displayed second within the block.

TemplateText?

The text displayed third within the block.

Public constructors

TextBlock

Added in 1.0.0-alpha06
TextBlock(
    text1: TemplateText,
    text2: TemplateText? = null,
    text3: TemplateText? = null,
    priority: @IntRange(from = 0) Int = 0
)
Parameters
text1: TemplateText

The text displayed first within the block.

text2: TemplateText? = null

The text displayed second within the block.

text3: TemplateText? = null

The text displayed third within the block.

priority: @IntRange(from = 0) Int = 0

The display priority number relative to other blocks.

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

Public properties

priority

Added in 1.0.0-alpha06
val priorityInt

The display priority number relative to other blocks.

text1

Added in 1.0.0-alpha06
val text1TemplateText

The text displayed first within the block.

text2

Added in 1.0.0-alpha06
val text2TemplateText?

The text displayed second within the block.

text3

Added in 1.0.0-alpha06
val text3TemplateText?

The text displayed third within the block.