Skip to content

Commit cf4c8ea

Browse files
authored
[Android Auto] Bump example to 2.10 (#6753)
* [Android Auto] Bump example to 2.10 * Fix app set destination issue
1 parent 5d52e38 commit cf4c8ea

4 files changed

Lines changed: 9 additions & 57 deletions

File tree

android-auto-app/build.gradle

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,11 @@ dependencies {
6969
// Mapbox Navigation Android Auto SDK
7070
implementation project(':libnavui-androidauto')
7171

72-
// This library will depend on the latest stable version.
73-
implementation("com.mapbox.navigation:ui-dropin:2.9.3")
72+
// This example is used for development so it may depend on unstable versions.
73+
// Examples based on final versions can be found in the examples repository.
74+
// https://github.com/mapbox/mapbox-navigation-android-examples
75+
implementation("com.mapbox.navigation:ui-dropin:2.10.0-rc.1")
76+
implementation("com.mapbox.search:mapbox-search-android:1.0.0-beta.42")
7477

7578
// Dependencies needed for this example.
7679
implementation dependenciesList.androidXAppCompat

android-auto-app/src/main/java/com/mapbox/navigation/examples/androidauto/CarAppSyncComponent.kt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@ class CarAppSyncComponent private constructor() : MapboxNavigationObserver {
8484
}
8585
}
8686

87-
override fun onDestinationPreview() {
88-
logI(LOG_TAG, "updateCarAppState onDestinationPreview")
89-
MapboxScreenManager.replaceTop(MapboxScreen.FREE_DRIVE)
90-
}
91-
9287
override fun onRoutePreview() {
9388
logI(LOG_TAG, "updateCarAppState onRoutePreview")
9489
MapboxScreenManager.replaceTop(MapboxScreen.ROUTE_PREVIEW)

android-auto-app/src/main/java/com/mapbox/navigation/examples/androidauto/ReplayRouteTripSession.kt

Lines changed: 0 additions & 47 deletions
This file was deleted.

android-auto-app/src/main/java/com/mapbox/navigation/examples/androidauto/car/MainCarSession.kt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ import com.mapbox.maps.extension.androidauto.MapboxCarMap
3030
import com.mapbox.navigation.base.ExperimentalPreviewMapboxNavigationAPI
3131
import com.mapbox.navigation.core.lifecycle.MapboxNavigationApp
3232
import com.mapbox.navigation.core.lifecycle.requireMapboxNavigation
33+
import com.mapbox.navigation.core.replay.route.ReplayRouteSession
3334
import com.mapbox.navigation.core.trip.session.TripSessionState
3435
import com.mapbox.navigation.examples.androidauto.CarAppSyncComponent
35-
import com.mapbox.navigation.examples.androidauto.ReplayRouteTripSession
3636
import kotlinx.coroutines.flow.collect
3737
import kotlinx.coroutines.launch
3838

@@ -58,6 +58,7 @@ class MainCarSession : Session() {
5858
}
5959
}
6060
private val mapboxNavigation by requireMapboxNavigation()
61+
private val replayRouteSession = ReplayRouteSession()
6162

6263
init {
6364
// Decide how you want the car and app to interact. In this example, the car and app
@@ -161,9 +162,9 @@ class MainCarSession : Session() {
161162
}
162163

163164
if (isAutoDriveEnabled) {
164-
MapboxNavigationApp.registerObserver(ReplayRouteTripSession)
165+
MapboxNavigationApp.registerObserver(replayRouteSession)
165166
} else {
166-
MapboxNavigationApp.unregisterObserver(ReplayRouteTripSession)
167+
MapboxNavigationApp.unregisterObserver(replayRouteSession)
167168
if (mapboxNavigation.getTripSessionState() != TripSessionState.STARTED) {
168169
mapboxNavigation.startTripSession()
169170
}

0 commit comments

Comments
 (0)