Maneuver.Builder
public
static
final
class
Maneuver.Builder
extends Object
java.lang.Object | |
↳ | com.google.android.libraries.car.app.navigation.model.Maneuver.Builder |
A builder of Maneuver
.
Summary
Public methods | |
---|---|
Maneuver
|
build()
Constructs the |
Maneuver.Builder
|
setIcon(CarIcon icon)
Sets an image representing the maneuver, or |
Maneuver.Builder
|
setRoundaboutExitAngle(int roundaboutExitAngle)
Sets an exit angle for roundabout maneuvers. |
Maneuver.Builder
|
setRoundaboutExitNumber(int roundaboutExitNumber)
Sets an exit number for roundabout maneuvers. |
Inherited methods | |
---|---|
Public methods
build
public Maneuver build ()
Constructs the Maneuver
defined by this builder.
Returns | |
---|---|
Maneuver |
Throws | |
---|---|
IllegalArgumentException |
if type includes an exit number and one has not been
set. |
IllegalArgumentException |
if type includes an exit angle and one has not been
set.
|
setIcon
public Maneuver.Builder setIcon (CarIcon icon)
Sets an image representing the maneuver, or null
to not set an image for the
maneuver.
Image Sizing Guidance
The provided image should have a maximum size of 64 x 64 dp. If the image exceeds this maximum size in either one of the dimensions, it will be scaled down and 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.
Parameters | |
---|---|
icon |
CarIcon |
Returns | |
---|---|
Maneuver.Builder |
setRoundaboutExitAngle
public Maneuver.Builder setRoundaboutExitAngle (int roundaboutExitAngle)
Sets an exit angle for roundabout maneuvers.
Use for when type
is Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE
or
Maneuver.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.
Parameters | |
---|---|
roundaboutExitAngle |
int |
Returns | |
---|---|
Maneuver.Builder |
Throws | |
---|---|
IllegalArgumentException |
if type does not include a exit angle. |
IllegalArgumentException |
if roundaboutExitAngle is not greater than zero and
less than or equal to 360 degrees.
|
setRoundaboutExitNumber
public Maneuver.Builder setRoundaboutExitNumber (int roundaboutExitNumber)
Sets an exit number for roundabout maneuvers.
Use for when type
is Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW
, Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CCW
, Maneuver.TYPE_ROUNDABOUT_ENTER_AND_EXIT_CW_WITH_ANGLE
or Maneuver.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.
Parameters | |
---|---|
roundaboutExitNumber |
int |
Returns | |
---|---|
Maneuver.Builder |
Throws | |
---|---|
IllegalArgumentException |
if type does not include a exit number. |
IllegalArgumentException |
if roundaboutExitNumber is not greater than zero.
|