onAnnouncementGenerated

abstract fun onAnnouncementGenerated(announcement: GuidanceAnnouncement, shouldPlay: Boolean)

Called whenever the upcoming maneuver announcement has been generated.

The announcement is generated based on the distance to maneuver, current instruction, and the next instruction. Configure the announcement verbosity by changing the property GuidanceEngine.announcementMode. If the property GuidanceEngine.announcementsEnabled is set to false, this method will not be invoked.

Parameters

announcement

GuidanceAnnouncement about the upcoming maneuver.

shouldPlay

Whether the announcement should be triggered.

Note: Do not rely on the shouldPlay parameter of the listener when:

  1. Using both GuidanceUpdatedListener and WarningUpdatedListener

  2. Using the AnnouncementConflictResolver to resolve the conflict between guidance and warning announcements.

See also

WarningUpdatedListener
AnnouncementConflictResolver