Skip to content

Commit d8321f2

Browse files
Android Auto NDK 27 support
1 parent 3cb5fb5 commit d8321f2

File tree

7 files changed

+23
-21
lines changed

7 files changed

+23
-21
lines changed

Makefile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -176,12 +176,12 @@ ui-unit-tests-release-jacoco:
176176
.PHONY: publish-local
177177
publish-local:
178178
./gradlew publishToMavenLocal
179-
./gradlew publishToMavenLocal -x libnavui-androidauto:mapboxSDKRegistryUpload -PndkMajor=27
179+
./gradlew publishToMavenLocal -PndkMajor=27
180180

181181
.PHONY: upload-to-sdk-registry-snapshot
182182
upload-to-sdk-registry-snapshot:
183183
./gradlew mapboxSDKRegistryUpload -Psnapshot=true
184-
./gradlew mapboxSDKRegistryUpload -x libnavui-androidauto:mapboxSDKRegistryUpload -Psnapshot=true -PndkMajor=27
184+
./gradlew mapboxSDKRegistryUpload -Psnapshot=true -PndkMajor=27
185185

186186
.PHONY: upload-to-sdk-registry
187187
upload-to-sdk-registry:
@@ -199,7 +199,8 @@ publish-to-sdk-registry:
199199

200200
.PHONY: upload-to-sdk-registry-androidauto
201201
upload-to-sdk-registry-androidauto:
202-
./gradlew libnavui-androidauto:mapboxSDKRegistryUpload;
202+
./gradlew libnavui-androidauto:mapboxSDKRegistryUpload
203+
./gradlew libnavui-androidauto:mapboxSDKRegistryUpload -PndkMajor=27
203204

204205
.PHONY: publish-to-sdk-registry-androidauto
205206
publish-to-sdk-registry-androidauto:

android-auto-app/build.gradle

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@ dependencies {
6969
// Mapbox Navigation Android Auto SDK
7070
implementation project(':libnavui-androidauto')
7171

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.3")
76-
implementation("com.mapbox.search:mapbox-search-android:1.0.0-rc.1")
77-
7872
// Dependencies needed for this example.
7973
implementation dependenciesList.androidXCore
8074
implementation dependenciesList.materialDesign
@@ -84,4 +78,4 @@ dependencies {
8478
implementation dependenciesList.androidXFragment
8579
implementation dependenciesList.androidXLifecycleLivedata
8680
implementation dependenciesList.androidXLifecycleRuntime
87-
}
81+
}

gradle.properties

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ android.enableJetifier=false
2929
# https://youtrack.jetbrains.com/issue/KT-46822
3030
systemProp.kotlin.daemon.jvm.options=-Xss8m
3131

32+
ndkMajor=27
33+
3234
# When configured, Gradle will run in incubating parallel mode.
3335
# This option should only be used with decoupled projects. More details, visit
3436
# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects

gradle/dependencies.gradle

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ ext {
3636
mapboxAnnotationPlugin : '0.8.0',
3737
mapboxBaseAndroid : '0.8.0',
3838
mapboxMapsAndroidAuto : '0.5.0',
39-
mapboxSearchAndroidAuto : '1.0.0-rc.1',
4039
androidXLifecycle : "${androidXLifecycleVersion}",
4140
androidXCoreVersion : '1.6.0',
4241
androidXArchCoreVersion : '2.1.0',
@@ -89,7 +88,6 @@ ext {
8988
mapboxNavigator : "com.mapbox.navigator:mapbox-navigation-native$ndkVersionSuffix:${version.mapboxNavigator}",
9089
mapboxCommonNative : "com.mapbox.common:common$ndkVersionSuffix:${version.mapboxCommonNative}",
9190
mapboxMapsAndroidAuto : "com.mapbox.extension:maps-androidauto:${version.mapboxMapsAndroidAuto}",
92-
mapboxSearchAndroidAuto : "com.mapbox.search:mapbox-search-android:${version.mapboxSearchAndroidAuto}",
9391

9492
/**
9593
* explicitly define Mapbox OkHttp dependency so that we are sure it's in sync with the Common SDK version we define
@@ -227,4 +225,14 @@ ext {
227225
mapboxNativeDownload : "com.mapbox.gradle.plugins:native-download:${pluginVersion.mapboxNativeDownload}",
228226
firebaseCrashlytics : "com.google.firebase:firebase-crashlytics-gradle:${pluginVersion.firebaseCrashlytics}"
229227
]
228+
229+
androidAutoVersions = [
230+
mapboxSearch : '1.5.0',
231+
mapboxNavigation: '2.21.0'
232+
]
233+
234+
androidAutoDependencies = [
235+
mapboxSearch : "com.mapbox.search:mapbox-search-android$ndkVersionSuffix:${androidAutoVersions.mapboxSearch}",
236+
mapboxNavigation: "com.mapbox.navigation:android$ndkVersionSuffix:${androidAutoVersions.mapboxNavigation}"
237+
]
230238
}

libnavui-androidauto/build.gradle

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,13 +38,10 @@ dependencies {
3838
// Jetpack car library.
3939
api(dependenciesList.mapboxMapsAndroidAuto)
4040

41-
// This defines the minimum version of Navigation which is included in this SDK. To upgrade the
42-
// Navigation versions, you can specify a newer version in your downstream build.gradle.
43-
api("com.mapbox.navigation:android:2.10.3")
44-
45-
// Search is currently in beta so it is not included in this SDK. The functionality of search
46-
// is included behind this library's api.
47-
implementation(dependenciesList.mapboxSearchAndroidAuto)
41+
// This defines the minimum version of Navigation and Search that are included in this SDK.
42+
// To upgrade the versions, you can specify a newer versions in your downstream build.gradle.
43+
api(androidAutoDependencies.mapboxNavigation)
44+
implementation(androidAutoDependencies.mapboxSearch)
4845

4946
implementation(dependenciesList.androidXAppCompat)
5047
implementation(dependenciesList.coroutinesCore)

libnavui-androidauto/src/main/java/com/mapbox/androidauto/feedback/ui/CarFeedbackIconDownloader.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import android.net.Uri
55
import androidx.car.app.Screen
66
import androidx.car.app.model.CarIcon
77
import androidx.core.graphics.drawable.IconCompat
8-
import androidx.core.graphics.drawable.toBitmap
98
import androidx.lifecycle.lifecycleScope
109
import com.bumptech.glide.Glide
1110
import com.bumptech.glide.RequestManager
1211
import com.bumptech.glide.request.target.CustomTarget
1312
import com.bumptech.glide.request.transition.Transition
13+
import com.mapbox.navigation.utils.internal.android.toBitmap
1414
import kotlinx.coroutines.launch
1515
import kotlinx.coroutines.suspendCancellableCoroutine
1616
import kotlinx.coroutines.withTimeoutOrNull

libnavui-androidauto/src/main/java/com/mapbox/androidauto/internal/search/CarPlaceSearchImpl.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class CarPlaceSearchImpl(
8686

8787
return suspendCancellableCoroutine { continuation ->
8888
val selectionCallback = object : SearchSelectionCallback {
89-
override fun onCategoryResult(
89+
override fun onResults(
9090
suggestion: SearchSuggestion,
9191
results: List<SearchResult>,
9292
responseInfo: ResponseInfo

0 commit comments

Comments
 (0)