Skip to content

Conversation

@cammace
Copy link

@cammace cammace commented Apr 28, 2017

Closes #18

  • Open ticket in android-docs to document this.

@cammace cammace added enhancement ⚠️ DO NOT MERGE PR should not be merged! labels Apr 28, 2017
@cammace cammace self-assigned this Apr 28, 2017
@cammace cammace requested a review from zugaldia April 28, 2017 17:16
Copy link
Member

@zugaldia zugaldia left a 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;
Copy link
Member

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.

Copy link
Author

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;
Copy link
Member

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.

@cammace cammace added ready for review and removed ⚠️ DO NOT MERGE PR should not be merged! labels Apr 28, 2017
@cammace
Copy link
Author

cammace commented Apr 28, 2017

All finished up here @zugaldia, can I get another review? :)

  • Open ticket on including toString, hashcode, and equalTo methods to options class

^ 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;
Copy link
Member

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?

Copy link
Author

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;
Copy link
Member

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?

Copy link
Author

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).

@zugaldia
Copy link
Member

@cammace I think we're almost there. Just a couple of questions.

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