public final class

MessageInfo.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.navigation.model.MessageInfo.Builder

Overview

A builder of MessageInfo.

Summary

Constructors
publicBuilder(CarText title)

Returns a new instance of a MessageInfo.Builder.

publicBuilder(java.lang.CharSequence title)

Returns a new instance of a MessageInfo.Builder.

Methods
public MessageInfobuild()

Constructs the MessageInfo defined by this builder.

public MessageInfo.BuildersetImage(CarIcon image)

Sets the image to display along with the message.

public MessageInfo.BuildersetText(CarText text)

Sets additional text on the message, with support for multiple length variants.

public MessageInfo.BuildersetText(java.lang.CharSequence text)

Sets additional text on the message.

public MessageInfo.BuildersetTitle(java.lang.CharSequence title)

Sets the title of the message.

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

Constructors

public Builder(java.lang.CharSequence title)

Returns a new instance of a MessageInfo.Builder.

Only DistanceSpans and DurationSpans are supported in the input string.

public Builder(CarText title)

Returns a new instance of a MessageInfo.Builder.

Spans are not supported in the input string and will be ignored.

Methods

public MessageInfo.Builder setTitle(java.lang.CharSequence title)

Sets the title of the message.

Only DistanceSpans and DurationSpans are supported in the input string.

See also: CarText

public MessageInfo.Builder setText(java.lang.CharSequence text)

Sets additional text on the message.

Only DistanceSpans and DurationSpans are supported in the input string.

See also: CarText

public MessageInfo.Builder setText(CarText text)

Sets additional text on the message, with support for multiple length variants.

Only DistanceSpans and DurationSpans are supported in the input string.

See also: CarText

public MessageInfo.Builder setImage(CarIcon image)

Sets the image to display along with the message.

Image Sizing Guidance

To minimize scaling artifacts across a wide range of car screens, apps should provide images targeting a 128 x 128 dp bounding box. If the image exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving the aspect ratio.

See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.

public MessageInfo build()

Constructs the MessageInfo defined by this builder.