Step.Builder

public static final class Step.Builder
extends Object

java.lang.Object
   ↳ androidx.car.cluster.navigation.Step.Builder


Builder for creating a Step

Summary

Public constructors

Step.Builder()

Public methods

Step.Builder addLane(Lane lane)

Adds a road lane configuration to this step.

Step build()

Returns a Step built with the provided information.

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).

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.

Step.Builder setLanesImage(ImageReference lanesImage)

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

Step.Builder setManeuver(Maneuver maneuver)

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

Inherited methods

Public constructors

Step.Builder

public Step.Builder ()

Public methods

addLane

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 setLanesImage(ImageReference)) and metadata (through this method) for maximum interoperability, as some consumers might use images while others might use metadata, or both.

Parameters
lane Lane

Returns
Step.Builder this object for chaining

build

public Step build ()

Returns a Step built with the provided information.

Returns
Step

setCue

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.

Parameters
cue RichText

Returns
Step.Builder this object for chaining

setDistance

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.

Parameters
distance Distance

Returns
Step.Builder this object for chaining

setLanesImage

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 addLane(Lane)) and image (through this method) for maximum interoperability, as some consumers might use images while others might use metadata, or both.

Parameters
lanesImage ImageReference

Returns
Step.Builder this object for chaining

setManeuver

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.

Parameters
maneuver Maneuver

Returns
Step.Builder this object for chaining