SpeedAlertOptions.Builder

  • SpeedAlertOptions.Builder allows customization of speed alert behavior in navigation.

  • It provides methods to set thresholds for minor and major speed alerts based on percentage exceeding the speed limit.

  • You can configure the duration for a minor alert to escalate into a major alert.

  • Building a SpeedAlertOptions instance requires setting thresholds for both minor and major alerts using setSpeedAlertThresholdPercentage.

  • build() method is used to create a SpeedAlertOptions object after configuring the desired settings.

public static final class SpeedAlertOptions.Builder extends Object

Builder for building SpeedAlertOptions.

Public Constructor Summary

Builder()
Creates an empty builder.

Public Method Summary

SpeedAlertOptions
build()
SpeedAlertOptions.Builder
setSeverityUpgradeDurationSeconds(double seconds)
Sets the time in seconds needed to upgrade speed alerts from SpeedAlertSeverity.MINOR to SpeedAlertSeverity.MAJOR.
SpeedAlertOptions.Builder
setSpeedAlertThresholdPercentage(SpeedAlertSeverity speedAlertSeverity, float percentageAboveLimit)
Sets the triggering threshold as a percentage for the speed alert of the specified SpeedAlertSeverity.

Inherited Method Summary

Public Constructors

public Builder ()

Creates an empty builder.

Public Methods

public SpeedAlertOptions build ()

Builds a SpeedAlertOptions.

Setting the same percentage threshold for SpeedAlertSeverity.MINOR and SpeedAlertSeverity.MAJOR speed alerts disables the SpeedAlertSeverity.MINOR speed alert and will only allow SpeedAlertSeverity.MAJOR speed alert.

Throws
IllegalArgumentException if not all of the following conditions are satisfied:

public SpeedAlertOptions.Builder setSeverityUpgradeDurationSeconds (double seconds)

Sets the time in seconds needed to upgrade speed alerts from SpeedAlertSeverity.MINOR to SpeedAlertSeverity.MAJOR.

Speeding over SpeedAlertSeverity.MINOR percentage threshold for longer than specified seconds triggers SpeedAlertSeverity.MAJOR speed alert.

Parameters
seconds

public SpeedAlertOptions.Builder setSpeedAlertThresholdPercentage (SpeedAlertSeverity speedAlertSeverity, float percentageAboveLimit)

Sets the triggering threshold as a percentage for the speed alert of the specified SpeedAlertSeverity.

You need this method to customize the speed alert triggering thresholds as a percentage for both SpeedAlertSeverity.MINOR and SpeedAlertSeverity.MAJOR alerts.

Parameters
speedAlertSeverity
percentageAboveLimit