Android Dev Summit, October 23-24: two days of technical content, directly from the Android team. Sign-up for livestream updates.

Builder

class Builder
kotlin.Any
   ↳ androidx.car.cluster.navigation.Step.Builder

Builder for creating a Step

Summary

Public constructors

Builder for creating a Step

Public methods

Step.Builder
addLane(@NonNull lane: Lane)

Adds a road lane configuration to this step.

Step

Returns a Step built with the provided information.

Step.Builder
setCue(@Nullable cue: RichText?)

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(@Nullable 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(@Nullable lanesImage: ImageReference?)

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

Step.Builder
setManeuver(@Nullable maneuver: Maneuver?)

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

Public constructors

<init>

Builder()

Builder for creating a Step

Public methods

addLane

@NonNull fun addLane(@NonNull lane: Lane): Step.Builder

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.

Return
Step.Builder: this object for chaining

build

@NonNull fun build(): Step

Returns a Step built with the provided information.

setCue

@NonNull fun setCue(@Nullable cue: RichText?): Step.Builder

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.

Return
Step.Builder: this object for chaining

setDistance

@NonNull fun setDistance(@Nullable distance: Distance?): Step.Builder

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.

Return
Step.Builder: this object for chaining

setLanesImage

@NonNull fun setLanesImage(@Nullable lanesImage: ImageReference?): Step.Builder

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.

Return
Step.Builder: this object for chaining

setManeuver

@NonNull fun setManeuver(@Nullable maneuver: Maneuver?): Step.Builder

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

Return
Step.Builder: this object for chaining