mapbox-navigation-android
mapbox-navigation-android copied to clipboard
[Android Auto] Remove direct `MapboxNavigation` references
All of the direct references to MapboxNavigation
are to be deleted from the public api in favor of MapboxNavigationObserver
or MapboxNavigationApp.current()
.
The MapboxNavigationApp
did not exist during the original implementation, so only the most recent implementations are using the MapboxNavigationApp
. This refactor will unlock the ability to disable and enable NavigationOptions
at runtime.
When choosing to use MapboxNavigationObserver
vs MapboxNavigationApp.current()
- Use
MapboxNavigationObserver
when registering for continuous data streams - Use
MapboxNavigationApp.current()
for special cases, typically when a single is needed
Here is a list of classes that need to be migrated.
- [x] CarNotificationInterceptor - already done, reference as a correct example
- [x] CarAppLocation - already done, reference as a correct example
- [x] MapboxCarNavigationManager - already done, reference as a correct example
- [ ] MainCarContext: MainActionStrip, MainCarScreen, MainScreenManager
- [ ] CarSpeedLimitRenderer https://github.com/mapbox/mapbox-navigation-android/pull/6325
- [x] RoutePreviewCarContext, GeoDeeplinkNavigateAction https://github.com/mapbox/mapbox-navigation-android/pull/6226
- [ ] CarActiveGuidanceCarContext, ActiveGuidanceScreen
- [x] CarNavigationInfoObserver https://github.com/mapbox/mapbox-navigation-android/pull/6263
- [x] CarLocationsOverviewCamera https://github.com/mapbox/mapbox-navigation-android/pull/6225
- [x] CarNavigationCamera https://github.com/mapbox/mapbox-navigation-android/pull/6219
- [x] CarRouteLine https://github.com/mapbox/mapbox-navigation-android/pull/6219
- [x] RoadLabelSurfaceLayer https://github.com/mapbox/mapbox-navigation-android/pull/6224
- [x] RoadNameObserver https://github.com/mapbox/mapbox-navigation-android/pull/6224
- [ ] CarRouteRequest
- [x] CarAppLocation
Before refactoring this entirely, there should be consensus on this https://github.com/mapbox/mapbox-navigation-android/pull/6143
All done