public final class

Destination.Builder

extends java.lang.Object

 java.lang.Object

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

Overview

A builder of Destination.

Summary

Constructors
publicBuilder()

Returns an empty Destination.Builder instance.

Methods
public Destinationbuild()

Constructs the Destination defined by this builder.

public Destination.BuildersetAddress(java.lang.CharSequence address)

Sets the destination address formatted for the user's current locale.

public Destination.BuildersetImage(CarIcon image)

Sets the destination image to display.

public Destination.BuildersetName(java.lang.CharSequence name)

Sets the destination name formatted for the user's current locale.

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

Constructors

public Builder()

Returns an empty Destination.Builder instance.

Methods

public Destination.Builder setName(java.lang.CharSequence name)

Sets the destination name formatted for the user's current locale.

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

See also: CarText

public Destination.Builder setAddress(java.lang.CharSequence address)

Sets the destination address formatted for the user's current locale.

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

See also: CarText

public Destination.Builder setImage(CarIcon image)

Sets the destination image to display.

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 Destination build()

Constructs the Destination defined by this builder.

At least one of the name or the address must be set and not empty.

See also: Destination.Builder.setName(CharSequence), Destination.Builder.setAddress(CharSequence)