mapbox / mapbox/mapbox-navigation-android
Drop-In NavigationView has weird interaction with prefetched route with MapboxNavigation
Nessuno ha ancora preso questa issue.
- Lingua principale
- Kotlin
- Stelle
- 651
- Fork
- 321
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Descrizione
**Android API:** Android 12, Google Pixel 6a
**Mapbox Navigation SDK version:** 2.9.2
So I am experiencing a weird glitch when using NavigationView to create a turn by turn navigation with the Drop-In UI library. My app has a fragment which uses MapView to show a route of delivery. If tapped on start order, the NavigationActivity is called which hosts a NavigationView
The Fragment fetches the route with `mapboxNavigation.requestRoutes()` and sets the navigation route within `onRoutesReady()`
```
mapboxNavigation.requestRoutes(routeOptions, new NavigationRouterCallback() {
@Override
public void onRoutesReady(@NonNull List list, @NonNull RouterOrigin routerOrigin) {
if (list.size() > 0) {
mapboxNavigation.setNavigationRoutes(list);
mainMapBoxMap.getStyle(style1 -> {
routeLineApi.setNavigationRoutes(list, routeValues -> routeLineView.renderRouteDrawData(style1, routeValues));
CoordinateBounds latLngBounds = new CoordinateBounds(
Point.fromLngLat(origin.longitude(), origin.latitude()),
Point.fromLngLat(destination.longitude(), destination.latitude())
);
CameraOptions boundOptions = mainMapBoxMap.cameraForCoordinateBounds(latLngBounds, new EdgeInsets(100, 100, 1200, 100), 0.0, 0.0);
CameraAnimationsUtils.flyTo(mainMapBoxMap, boundOptions, new MapAnimationOptions.Builder().duration(7000).build());
});
} else {
Toast.makeText(getContext(), "Error fetching route", Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(@NonNull List list, @NonNull RouteOptions routeOptions) {
}
@Override
public void onCanceled(@NonNull RouteOptions routeOptions, @NonNull RouterOrigin routerOrigin) {
}
});
```
So here's the issue, when the app lands on NavigationActivity, The NavigationView is kind of zoomed in an doesn't show anything. if the speed limit widget is held, then the bottom sheet opens and we can start the navigation manually. Starting it this way makes it that voice assistance and ManeuverView both works as intended.
https://user-images.githubusercontent.com/119421818/207042025-9a3b27c8-1ec4-4690-8394-a10894a32f93.mp4
However, if the route preview is shown in NavigationActivity with `activityNavigationView.getApi().startRoutePreview(mapboxNavigation.getNavigationRoutes());` and then the start navigation button is tapped, The voice assistance, and manevuerView doesn't work.
https://user-images.githubusercontent.com/119421818/207042288-80e69491-8351-480c-93b6-ec454cdc8edd.mp4
What am I missing here?
### Expected behavior
The manevureView and voice assistance to work properly when route navigation is started for both the cases.
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia con la configurazione di NavigationView in NavigationActivity e con il ciclo di vita del percorso intorno a requestRoutes(), onRoutesReady(), setNavigationRoutes() e startRoutePreview(). Riproduci entrambi i percorsi di avvio su Android 12 con SDK 2.9.2 e confrontane il comportamento. Il lavoro è completato quando entrambi i percorsi visualizzano il percorso e fanno funzionare ManeuverView e l'assistenza vocale.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- android
- Ambito
- mobile-dev
- Tipo di issue
- Bug
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 25/100