public final class

Step.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.cluster.navigation.Step.Builder

Overview

Builder for creating a Step

Summary

Constructors
publicBuilder()

Methods
public Step.BuilderaddLane(Lane lane)

Adds a road lane configuration to this step.

public Stepbuild()

Returns a Step built with the provided information.

public Step.BuildersetCue(RichText cue)

Sets auxiliary instructions on how complete this navigation step, described as a RichText object containing a sequence of texts (e.g.: "towards", "Wallaby way") and images (e.g.: road badge of a highway).

public Step.BuildersetDistance(Distance distance)

Sets the distance from the current position to the point where this navigation step should be executed, or null if distance to this step is not provided.

public Step.BuildersetLanesImage(ImageReference lanesImage)

Sets a reference to an image that represents a complete lanes configuration at this point in the navigation.

public Step.BuildersetManeuver(Maneuver maneuver)

Sets the maneuver to be performed on this step, or null if this step doesn't involve a maneuver.

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

Constructors

public Builder()

Methods

public Step.Builder setManeuver(Maneuver maneuver)

Sets the maneuver to be performed on this step, or null if this step doesn't involve a maneuver.

Returns:

this object for chaining

public Step.Builder setDistance(Distance distance)

Sets the distance from the current position to the point where this navigation step should be executed, or null if distance to this step is not provided.

Returns:

this object for chaining

public Step.Builder addLane(Lane lane)

Adds a road lane configuration to this step. Lanes should be added from left to right.

If lanes configuration information is available, producers should provide both image (see Step.Builder.setLanesImage(ImageReference)) and metadata (through this method) for maximum interoperability, as some consumers might use images while others might use metadata, or both.

Returns:

this object for chaining

public Step.Builder setLanesImage(ImageReference lanesImage)

Sets a reference to an image that represents a complete lanes configuration at this point in the navigation. The image, if provided, is expected to contain:

  • A representation of all lanes, one next to the other in a single row.
  • For each lane, a set of arrows, representing each possible driving directions (e.g.: straight, left turn, right turn, etc.) within such lane.
  • Each of such driving directions that would keep the driver within the navigation route should be highlighted.
Lane configuration images are expected to be displayed in a canvas with fixed height and variable width.

If lanes configuration information is available, producers should provide both metadata (see Step.Builder.addLane(Lane)) and image (through this method) for maximum interoperability, as some consumers might use images while others might use metadata, or both.

Returns:

this object for chaining

public Step.Builder setCue(RichText cue)

Sets auxiliary instructions on how complete this navigation step, described as a RichText object containing a sequence of texts (e.g.: "towards", "Wallaby way") and images (e.g.: road badge of a highway).

If consumers don't have enough space to display the complete content of this RichText instance, it is expected they will truncate these instructions by cutting its end.

Because of this, it is expected the most important part of these instructions to be located at the beginning of the sequence.

Returns:

this object for chaining

public Step build()

Returns a Step built with the provided information.