-
Notifications
You must be signed in to change notification settings - Fork 35
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
Navigate route with rerouting #316
base: v.next
Are you sure you want to change the base?
Conversation
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.
LGTM! Just some suggestions below, but happy to proceed to second review! Nice!
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
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.
@shubham7109 Great work, nice sample.
Some suggestions.
samples-lib/src/main/java/com/esri/arcgismaps/sample/sampleslib/components/MessageDialog.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
// Reset navigation to initial state | ||
resetNavigation() |
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.
wondering why this needs to be called on initialization?
In what cases will the navigation needs to be reset when initializing?
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.
Use cases:
initialize():
- Sets up location display
- Sets up text-to-speech
- Loads map and load route result
- Tigger reset
resetNavigation():
- Cancels navigation job. (not needed for initialization)
- Fix map rotation to north up. (not needed for initialization)
- Set viewpoint to route result. (needed for initialization & reset)
- Create the route ahead graphics and add them to the map. (needed for initialization & reset)
- Set up button states. (needed for initialization & reset)
To avoid repeated code on initialize
& resetNavigation
, I designed it so initialize loads, calculate the required resources, and then call the reset function to reset navigation to an initial (non-navigating) state. If there is a name change that may work better than resetNavigation
, feel free to comment below.
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.
thanks for the well detailed explanation.
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Show resolved
Hide resolved
...sri/arcgismaps/sample/navigateroutewithrerouting/screens/NavigateRouteWithReroutingScreen.kt
Outdated
Show resolved
Hide resolved
...cgismaps/sample/navigateroutewithrerouting/components/NavigateRouteWithReroutingViewModel.kt
Outdated
Show resolved
Hide resolved
Thank you for the review @eri9000, I added in the PR comments & feedback changes, and the PR is now ready for your re-review. 👍 |
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.
Good work 👍🏼 LGTM
fontWeight = FontWeight.Bold | ||
) | ||
Text( | ||
text = timeRemainingText, |
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.
To improve visibility, can you add a space in between the title and text?
applies to the others as well
Description
PR to add a new Kotlin sample "Navigate route with rerouting" in
Routing and Logistics
category.Links and Data
Sample issue: #1414
What To Review
README.md
andREADME.metadata.json
files