public final class

RichTextElement.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.cluster.navigation.RichTextElement.Builder

Overview

Builder for creating a RichTextElement

Summary

Constructors
publicBuilder()

Methods
public RichTextElementbuild()

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

public RichTextElement.BuildersetImage(ImageReference image)

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

public RichTextElement.BuildersetText(java.lang.String text)

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

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: image reference to be used to represent this element, or null if only the textual representation should be used.

Returns:

this object for chaining

public RichTextElement.Builder setText(java.lang.String text)

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

Parameters:

text: textual representation to use

Returns:

this object for chaining

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.