It's happening now, watch the livestream.

RichTextElement

public class RichTextElement
extends Object implements VersionedParcelable

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


An item in a RichText sequence, acting as a union of different graphic elements that can be displayed one after another.

A RichTextElement can contain text and a graphic element as its representation. Consumers must attempt to render the graphic element if present. In case of failure to render the element, the first line of fallback should be getText(). If that is also empty, fallback to RichText.getText() will be used.

New graphic element types might be added in the future. If such elements are unknown to the consumer, they will be delivered to the consumer as just text.

Summary

Nested classes

class RichTextElement.Builder

Builder for creating a RichTextElement  

Public methods

boolean equals(Object o)
ImageReference getImage()

Returns an image representing this element.

String getText()

Returns the textual representation of this element.

int hashCode()
String toString()

Inherited methods

Public methods

equals

public boolean equals (Object o)

Parameters
o Object

Returns
boolean

getImage

public ImageReference getImage ()

Returns an image representing this element. This representation should be used over the textual representation getText() whenever possible.

In case of failure to render, initial fallback to getText() should be used. Fallback to RichText.getText() should be used if textual fallback is not provided (empty string).

Returns
ImageReference

getText

public String getText ()

Returns the textual representation of this element.

If getImage() is provided, then this is used as a fallback in the case of render failures.

Returns
String

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String