-
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
Added flag to ignore route line updates in the view under certain con… #6974
Merged
+186
−13
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
- Fixed route progress vanishing point update issue introduced by feature that displays the active leg of the route line above inactive legs for multi-leg routes. [#6974](https://github.com/mapbox/mapbox-navigation-android/pull/6974) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,14 +13,18 @@ class RouteLineUpdateValue internal constructor( | |
val routeLineMaskingLayerDynamicData: RouteLineDynamicData? = null | ||
) { | ||
|
||
internal var ignorePrimaryRouteLineData = false | ||
|
||
/** | ||
* @return a class with mutable values for replacing. | ||
*/ | ||
fun toMutableValue() = MutableRouteLineUpdateValue( | ||
primaryRouteLineDynamicData, | ||
alternativeRouteLinesDynamicData, | ||
routeLineMaskingLayerDynamicData | ||
) | ||
).also { | ||
it.ignorePrimaryRouteLineData = ignorePrimaryRouteLineData | ||
} | ||
|
||
/** | ||
* Represents the mutable data for updating the appearance of the route lines. | ||
|
@@ -35,14 +39,18 @@ class RouteLineUpdateValue internal constructor( | |
var routeLineMaskingLayerDynamicData: RouteLineDynamicData? = null | ||
) { | ||
|
||
internal var ignorePrimaryRouteLineData = false | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. NIT: I'd specify default value only once as a constant. |
||
|
||
/** | ||
* @return a RouteLineUpdateValue | ||
*/ | ||
fun toImmutableValue() = RouteLineUpdateValue( | ||
primaryRouteLineDynamicData, | ||
alternativeRouteLinesDynamicData, | ||
routeLineMaskingLayerDynamicData | ||
) | ||
).also { | ||
it.ignorePrimaryRouteLineData = ignorePrimaryRouteLineData | ||
} | ||
} | ||
|
||
/** | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 can be dangerous:
RouteLineUpdateValue
to the client via consumer;toMutableValue/toImmutableValue
);It sounds artificial but who knows. I think we should transfer the flag value between mutable/immutable (we can do that and it seems like the only way the customer can modify the object).
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.
What you point out is true. However, before beta.3 this data was never returned in this code execution path. The only reason this was introduced was because the masking layers were added in this release and they had to be created and rendered here. The main route line data is included ONLY because the field is non-nullable. If the field had been nullable the main route line parameter would have been null. So even in the possibility you outline the data shouldn't be rendered and wouldn't be if the field had been nullable or could be changed to nullable (without breaking SEMVER).
The flag is introduced solely as a workaround for not being able to exclude the main route line data in a more elegant way and to get this method back to the state it was in prior to beta.3.
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.
I get that, no objections to that.
What I mean is imagine the situation:
This is possible, right? It doesn't have anything to do with beta.3. But with these modifications we lose the flag. Which I think shouldn't be the case. If we add a new property to the model class (even though it's internal),
toMutableValue + toImmutableValue
should keep it.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.
Yes good point, added.