Skip to content
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

Merged
merged 6 commits into from
Jul 13, 2017
Merged

Conversation

danesfeder
Copy link
Contributor

@danesfeder danesfeder commented Jul 7, 2017

Closes #103

This PR will allow developers to create their own custom instruction classes subclassing Instruction and setting it to the given Milestone.

When the Milestone is triggered, the String provided by setInstruction(RouteProgress) will be the String passed to the MilestoneEventListener

cc: @cammace @zugaldia @ericrwolfe

@danesfeder danesfeder added enhancement ⚠️ DO NOT MERGE PR should not be merged! labels Jul 7, 2017
@danesfeder danesfeder requested a review from cammace July 7, 2017 15:55
@danesfeder
Copy link
Contributor Author

@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()) {
Copy link
Contributor

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 {
Copy link
Contributor

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.

@danesfeder danesfeder added ready for review and removed ⚠️ DO NOT MERGE PR should not be merged! labels Jul 11, 2017
@cammace cammace added this to the v0.4.0 milestone Jul 12, 2017
@danesfeder danesfeder merged commit ebc743c into master Jul 13, 2017
@cammace cammace mentioned this pull request Aug 1, 2017
10 tasks
@cammace cammace deleted the dan-custom-instruction branch August 15, 2017 14:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants