Builder

class Builder
kotlin.Any
   ↳ androidx.car.cluster.navigation.RichTextElement.Builder

Builder for creating a RichTextElement

Summary

Public constructors

Builder for creating a RichTextElement

Public methods

RichTextElement

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

RichTextElement.Builder
setImage(@Nullable image: ImageReference?)

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

RichTextElement.Builder
setText(@Nullable text: String?)

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

Public constructors

<init>

Builder()

Builder for creating a RichTextElement

Public methods

build

@NonNull fun build(): RichTextElement

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.

setImage

@NonNull fun setImage(@Nullable image: ImageReference?): RichTextElement.Builder

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.
Return
RichTextElement.Builder: this object for chaining

setText

@NonNull fun setText(@Nullable text: String?): RichTextElement.Builder

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

Parameters
text String?: textual representation to use
Return
RichTextElement.Builder: this object for chaining