-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom Instructions for Milestones #122
Conversation
@cammace this is ready for a first round of 👀 |
@@ -102,12 +107,16 @@ public MapboxNavigation(@NonNull Context context, @NonNull String accessToken, | |||
offRouteListeners = new CopyOnWriteArrayList<>(); | |||
milestoneEventListeners = new CopyOnWriteArrayList<>(); | |||
milestones = new CopyOnWriteArrayList<>(); | |||
addDefaultMilestones(); | |||
|
|||
if (!options.defaultInstructionsDisabled()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's make this option defaultMilestonesEnabled()
* | ||
* @since 0.4.0 | ||
*/ | ||
public class DepartureInstruction extends Instruction { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than create separate files for each class, why not build these instructions directly in mapboxNavigation
near the milestone creation.
b74fa9b
to
60d4f5e
Compare
…lestoneEventListener
…ructions given during a nav session
60d4f5e
to
28d99c6
Compare
Closes #103
This PR will allow developers to create their own custom instruction classes subclassing
Instruction
and setting it to the givenMilestone
.When the
Milestone
is triggered, theString
provided bysetInstruction(RouteProgress)
will be theString
passed to theMilestoneEventListener
cc: @cammace @zugaldia @ericrwolfe