-
Notifications
You must be signed in to change notification settings - Fork 319
MapboxNavigationOptions object added #22
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
Conversation
zugaldia
left a comment
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 also add tests for the new class.
| public MapboxNavigationOptions setMaxTurnCompletionOffset( | ||
| @FloatRange(from = 0, to = 359) double maxTurnCompletionOffset) { | ||
| this.maxTurnCompletionOffset = maxTurnCompletionOffset; | ||
| return this; |
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.
This follows the builder pattern, but there's no Builder.
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.
discussed internally, since no logic is happening inside MapboxNavigationOptions it is a builder in itself and has no need for the same builder pattern inside Mapbox Java.
|
|
||
| private double maximumDistanceOffRoute = NavigationConstants.MAXIMUM_DISTANCE_BEFORE_OFF_ROUTE; | ||
| private double deadReckoningTimeInterval = NavigationConstants.DEAD_RECKONING_TIME_INTERVAL; | ||
| private double maxManipulatedCourseAngle = NavigationConstants.MAX_MANIPULATED_COURSE_ANGLE; |
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.
How about we do this in the constructor.
|
All finished up here @zugaldia, can I get another review? :)
^ reason why i'm not doing this now is because of mapbox/mapbox-java#450 |
| @Experimental public static final int HIGH_ALERT_LEVEL = 4; | ||
| @Experimental public static final int ARRIVE_ALERT_LEVEL = 5; | ||
| @Experimental public static final int METERS_TO_INTERSECTION = 50; | ||
| @Experimental public static final int DEFAULT_ANGLE_TOLERANCE = 45; |
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.
Why are these two constants being removed?
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.
They were part of previous logic I implemented that I removed in favor of what iOS has, these constants just never got removed and noticed while I was working on this PR.
| isBound = false; | ||
| navigationService = null; | ||
| snapToRoute = true; | ||
| profile = DirectionsCriteria.PROFILE_DRIVING_TRAFFIC; |
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.
Why isn't the current profile an option too? Because options can't change once you instantiated MapboxNavigation but profile can?
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.
Yeah, eventually we will support the usage of different profiles which means until the user actual starts the navigation session, they should have the option to change the profile (they'll also need to get a new DirectionsResponse if the profiles changed).
|
@cammace I think we're almost there. Just a couple of questions. |
Closes #18
android-docsto document this.