Maneuver.Builder
class Maneuver.Builder
A builder of Maneuver.
Summary
Public functions |
|
|---|---|
Maneuver |
build()Constructs the |
Maneuver.Builder |
Sets an image representing the maneuver. |
Maneuver.Builder |
setRoundaboutExitAngle(Sets an exit angle for roundabout maneuvers. |
Maneuver.Builder |
setRoundaboutExitNumber(roundaboutExitNumber: @IntRange(from = 1) Int)Sets an exit number for roundabout maneuvers. |
Public constructors
Builder
Builder(type: Int)
Constructs a new instance of a Builder.
The type should be chosen to reflect the closest semantic meaning of the maneuver. In some cases, an exact type match is not possible, but choosing a similar or slightly more general type is preferred. Using TYPE_UNKNOWN is allowed, but some head units will not display any information in that case.
| Parameters | |
|---|---|
type: Int |
one of the |
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
Public functions
build
fun build(): Maneuver
Constructs the Maneuver defined by this builder.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
setIcon
fun setIcon(icon: CarIcon): Maneuver.Builder
Sets an image representing the maneuver.
Icon Sizing Guidance To minimize scaling artifacts across a wide range of car screens, apps should provide icons targeting a 128 x 128 dp bounding box. If the icon exceeds this maximum size in either one of the dimensions, it will be scaled down to be centered inside the bounding box while preserving its aspect ratio.See CarIcon for more details related to providing icon and image resources that work with different car screen pixel densities.
| Throws | |
|---|---|
java.lang.NullPointerException |
if |
setRoundaboutExitAngle
fun setRoundaboutExitAngle(
roundaboutExitAngle: @IntRange(from = 1, to = 360) Int
): Maneuver.Builder
Sets an exit angle for roundabout maneuvers.
Use for when type is TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE or TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE. The roundaboutExitAngle represents the degrees traveled in circulation from the entrance to the exit.
For example, in a 4 exit example, if all the exits are equally spaced then exit 1 would be at 90 degrees, exit 2 at 180, exit 3 at 270 and exit 4 at 360. However if the exits are irregular then a different angle could be provided.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |
setRoundaboutExitNumber
fun setRoundaboutExitNumber(roundaboutExitNumber: @IntRange(from = 1) Int): Maneuver.Builder
Sets an exit number for roundabout maneuvers.
Use for when type is TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW, TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW, TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE or TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW_WITH_ANGLE. The
roundaboutExitNumber starts from 1 to designate the first exit after joining the roundabout, and increases in circulation order.
For example, if the driver is joining a counter-clockwise roundabout with 4 exits, then the exit to the right would be exit #1, the one straight ahead would be exit #2, the one to the left would be exit #3 and the one used by the driver to join the roundabout would be exit #4.
| Throws | |
|---|---|
java.lang.IllegalArgumentException |
if |