RichTextElement.Builder

public static final class RichTextElement.Builder
extends Object

java.lang.Object
   ↳ androidx.car.cluster.navigation.RichTextElement.Builder


Builder for creating a RichTextElement

Summary

Public constructors

RichTextElement.Builder()

Public methods

RichTextElement build()

Builds a RichTextElement with an optional textual representation, and any other optional representation provided to this builder.

RichTextElement.Builder setImage(ImageReference image)

Sets an image to be displayed as part of the RichText sequence.

RichTextElement.Builder setText(String text)

Sets the textual representation for this element to be displayed as part of the RichText sequence.

Inherited methods

Public constructors

RichTextElement.Builder

public RichTextElement.Builder ()

Public methods

build

public RichTextElement build ()

Builds a RichTextElement with an optional textual representation, and any other optional representation provided to this builder. If no other graphic element is provided or if such graphic element cannot be rendered by the consumer, text will be used instead.

Returns
RichTextElement

setImage

public RichTextElement.Builder setImage (ImageReference image)

Sets an image to be displayed as part of the RichText sequence. Images in the same RichText sequence are expected to be rendered with equal height but variable width.

Parameters
image ImageReference: image reference to be used to represent this element, or null if only the textual representation should be used.

Returns
RichTextElement.Builder this object for chaining

setText

public RichTextElement.Builder setText (String text)

Sets the textual representation for this element to be displayed as part of the RichText sequence.

Parameters
text String: textual representation to use

Returns
RichTextElement.Builder this object for chaining