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.
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
Fix/android/view builder and speed json #360
Fix/android/view builder and speed json #360
Changes from all commits
b5151f0
8a989e7
a1dd74b
8a7659b
a7d5d28
2d4f5f7
92a2b5e
7b892e0
44d9608
16b733f
85cb6c1
cf66c20
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
@ahmedre based on your comment, I've renamed this to
navigationUiState
. My thought was most of the time a developer will just passnavigationUiState
into whateverNavigationView
they're using from ferrostar. If they want additional custom ui state, they now have access to common name and can even merge innavigationUiState
into their custom state. A custom view model may look something like 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.
We now try catch and pass null when the serialization fails.
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.
@ahmedre I believe the actual key should be
"speed"
when there's a value. E.g.Let me know if there are additional cases. Definitely a bit of an obnoxious json object 😄.
Also, do we want to try catch the annotations parsing? On iOS we just convert a json parsing error to nil/null for annotations and an onError callback so that developers can log the failure. We figured better to let navigation succeed even in the case of a degraded/malformed annotations. See
ferrostar/apple/Sources/FerrostarCore/Annotations/AnnotationPublisher.swift
Lines 70 to 75 in 61e299a
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, you are right - my mistake! agree re: try/catching the parsing with an error callback 👍
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.
@ianthetechie now that this view model uses the
DefaultNavigationViewModel
. We should be able to refactor it to use the existing uiState from ferrostar and implement its own additional state for things like route loading, etc. Just to highlight how easy it is to customize without interrupting the default navigation behavior.