-
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
Move faster route out of mapbox navigation #2577
Conversation
...-core/src/main/java/com/mapbox/navigation/core/directions/session/MapboxDirectionsSession.kt
Outdated
Show resolved
Hide resolved
385f84a
to
a7eae5e
Compare
libnavigation-core/src/main/java/com/mapbox/navigation/core/MapboxNavigation.kt
Outdated
Show resolved
Hide resolved
Codecov Report
@@ Coverage Diff @@
## master #2577 +/- ##
=========================================
Coverage 29.16% 29.16%
Complexity 1061 1061
=========================================
Files 281 281
Lines 10731 10731
Branches 870 870
=========================================
Hits 3130 3130
Misses 7258 7258
Partials 343 343 |
...avigation-core/src/main/java/com/mapbox/navigation/core/fasterroute/FasterRouteController.kt
Outdated
Show resolved
Hide resolved
...avigation-core/src/main/java/com/mapbox/navigation/core/fasterroute/FasterRouteController.kt
Show resolved
Hide resolved
private val tripSession: TripSession | ||
) { | ||
private val fasterRouteTimer = MapboxTimer() | ||
private val fasterRouteObservers = CopyOnWriteArrayList<FasterRouteObserver>() |
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 think one class will have only one instance of FasterRouteTimer
; hence does this need to be a list?
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.
agree with this. but also out of scope of this refactor because many of our interfaces support multiple subscribers
Lines 379 to 383 in d08f1e5
mapboxNavigation.registerLocationObserver(locationObserver) | |
mapboxNavigation.registerRouteProgressObserver(routeProgressObserver) | |
mapboxNavigation.registerRoutesObserver(routesObserver) | |
mapboxNavigation.registerTripSessionStateObserver(tripSessionStateObserver) | |
mapboxNavigation.registerFasterRouteObserver(fasterRouteObserver) |
would prefer to separate that refactor
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.
Other interfaces support multiple subscribers because a client can do his own implementation along with MapboxNavigation
doing one itself. Whereas it is different for FasterRoute
because only MapboxNavigation
can register for it, whereas others will observe it. There is no need to have a list of subscribers.
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.
Ok I was refactoring a few things, and considered this part out of scope. Do you mind if I make that part a separate pull request?
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 would prefer to do it in the same PR given the fact it's just a couple of line changes.
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.
Ok cool, pushed an update ❤️
...avigation-core/src/main/java/com/mapbox/navigation/core/fasterroute/FasterRouteController.kt
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.
Love this kind of PRs, refactoring stuff around so entities live where they should, decluttering other classes (like MapboxNavigation
in this particular case) so they don't keep growing and growing. Great work @kmadsen ❤️
Left a minor question / comment.
...gation-core/src/main/java/com/mapbox/navigation/core/directions/session/DirectionsSession.kt
Outdated
Show resolved
Hide resolved
ba6799c
to
fab3dcd
Compare
486a1e6
to
8e2120a
Compare
6c83e38
to
fb755b7
Compare
8e2120a
to
57280b6
Compare
1ad3fdb
to
9abe006
Compare
* Move faster route out of mapbox navigation * rename * Move to separate class * update test Co-authored-by: Kyle Madsen <>
Description
MapboxNavigation is not going to scale with features like Faster Route added to the middle of it. This builds on top of the MapboxTimer to move faster route out of the core class.
#2575
bug
,feature
,new API(s)
,SEMVER
, etc.)Testing
Please describe the manual tests that you ran to verify your changes
SNAPSHOT
upstream dependencies if needed) through testapp/demo app and run all activities to avoid regressionsChecklist
CHANGELOG
including this PRcc: @abhishek1508 @olegzil @Guardiola31337