Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ApiDemos/project/common-ui/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ dependencies {
implementation(libs.material)
implementation(libs.play.services.maps)
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.espresso.core)
}
1 change: 1 addition & 0 deletions ApiDemos/project/java-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ dependencies {
// Tests
testImplementation(libs.junit)
androidTestImplementation(libs.espresso.idling.resource)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.truth)
Expand Down
1 change: 1 addition & 0 deletions ApiDemos/project/kotlin-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ dependencies {

// Tests
testImplementation(libs.junit)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.truth)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import com.google.common.truth.Truth
*/
class LatLngBoundsSubject private constructor(
failureMetadata: FailureMetadata,
private val actual: LatLngBounds
private val actual: LatLngBounds?
) : Subject(failureMetadata, actual) {

/**
Expand All @@ -35,8 +35,8 @@ class LatLngBoundsSubject private constructor(
*/
fun containsWithTolerance(expected: LatLng) {
val tolerance = 1e-5
val contains = actual.southwest.latitude - tolerance <= expected.latitude &&
expected.latitude <= actual.northeast.latitude + tolerance &&
val contains = actual!!.southwest.latitude - tolerance <= expected.latitude &&
expected.latitude <= actual!!.northeast.latitude + tolerance &&
isLongitudeWithinBounds(expected.longitude, actual, tolerance)
if (!contains) {
failWithActual("expected to contain", expected)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import kotlin.math.abs
*/
class LatLngSubject private constructor(
failureMetadata: FailureMetadata,
private val actual: LatLng
private val actual: LatLng?
) : Subject(failureMetadata, actual) {

/**
Expand All @@ -41,8 +41,8 @@ class LatLngSubject private constructor(
*/
fun isNear(expected: LatLng) {
val tolerance = 1e-6
if (abs(actual.latitude - expected.latitude) > tolerance ||
abs(actual.longitude - expected.longitude) > tolerance
if (abs(actual!!.latitude - expected.latitude) > tolerance ||
abs(actual!!.longitude - expected.longitude) > tolerance
) {
failWithActual("expected to be near", expected)
}
Expand All @@ -63,7 +63,7 @@ class LatLngSubject private constructor(
* Asserts that the actual [LatLng] is within [tolerance] meters of the [expected] [LatLng].
*/
fun of(expected: LatLng) {
val distance = SphericalUtil.computeDistanceBetween(actual, expected)
val distance = SphericalUtil.computeDistanceBetween(actual!!, expected)
if (distance > tolerance) {
failWithActual("expected to be within $tolerance meters of $expected [was $distance meters away]", expected)
}
Expand Down
2 changes: 2 additions & 0 deletions FireMarkers/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@
// ---------------------------------------------------------------------------------------------
implementation(libs.dagger)
ksp(libs.hilt.android.compiler)
ksp("org.jetbrains.kotlin:kotlin-metadata-jvm:2.3.0")

Check warning

Code scanning / Android Lint

Use TOML Version Catalog Instead Warning

Use version catalog instead
implementation(libs.hilt.android)

// ---------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -179,6 +180,7 @@
// AndroidX Test libraries for JUnit and Espresso, as well as Compose-specific testing tools
// for UI testing.
// ---------------------------------------------------------------------------------------------
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.junit)
androidTestImplementation(libs.espresso.core)
androidTestImplementation(platform(libs.compose.bom))
Expand Down
3 changes: 2 additions & 1 deletion WearOS/Wearable/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ dependencies {
//
// [versions]
// playServicesMaps = "20.0.0"
// wear = "1.3.0"
// wear = "1.4.0"
// wearable = "2.9.0"
//
// [libraries]
Expand All @@ -84,6 +84,7 @@ dependencies {
androidTestImplementation(libs.espresso.core)
androidTestImplementation(libs.uiautomator)
androidTestImplementation(libs.truth)
androidTestImplementation(libs.ext.junit)
androidTestImplementation(libs.junit)

// If your project does not use a version catalog, you can use the following dependencies instead:
Expand Down
9 changes: 9 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,13 @@ plugins {
alias(libs.plugins.secrets.gradle.plugin) apply false
alias(libs.plugins.hilt.android) apply false
alias(libs.plugins.ksp) apply false
}

allprojects {
configurations.all {
resolutionStrategy {
force("androidx.core:core:1.18.0")
force("androidx.core:core-ktx:1.18.0")
}
}
}
1 change: 1 addition & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@ org.gradle.jvmargs=-Xmx6g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8
# org.gradle.parallel=true
android.enableJetifier=true
android.useAndroidX=true
android.suppressUnsupportedCompileSdk=37,37.0
39 changes: 21 additions & 18 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,62 +2,63 @@
# Project Configuration
androidGradlePlugin = "8.13.2"
minSdk = "24"
compileSdk = "36"
targetSdk = "36"
compileSdk = "37"
targetSdk = "37"
versionCode = "1"
versionName = "2.0.2" # {x-release-please-version}
javaVersion = "17"

# Kotlin & Coroutines
kotlin = "2.2.0"
kotlin = "2.3.10"

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of org.jetbrains.kotlin:kotlin-stdlib than 2.3.10 is available: 2.4.0

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of org.jetbrains.kotlin.android than 2.3.10 is available: 2.4.10

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of org.jetbrains.kotlin.plugin.compose than 2.3.10 is available: 2.4.10

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of org.jetbrains.kotlin.plugin.parcelize than 2.3.10 is available: 2.4.10

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of org.jetbrains.kotlin.plugin.serialization than 2.3.10 is available: 2.4.10
kotlinxCoroutinesTest = "1.10.2"
kotlinxDatetime = "0.7.1"
kotlinxDatetime = "0.8.0"
ksp = "2.2.20-2.0.4"

# AndroidX Core & Jetpack
activity = "1.12.2"
activityKtx = "1.12.2"
activity = "1.13.0"
activityKtx = "1.13.0"
androidxJunit = "1.3.0" # Test ext
appcompat = "1.7.1"
cardview = "1.0.0"
constraintlayout = "2.2.1"
coreKtx = "1.17.0"
coreKtx = "1.18.0"

Check warning

Code scanning / Android Lint

Obsolete Gradle Dependency Warning

A newer version of androidx.core:core-ktx than 1.18.0 is available: 1.19.0
lifecycle = "2.10.0"
multidex = "2.0.1"
navigation = "2.9.6"
navigation = "2.9.8"
recyclerview = "1.4.0"

# Jetpack Compose
compose = "1.10.1"
composeBom = "2026.01.00"
compose = "1.11.4"
composeBom = "2026.06.01"
hiltNavigationCompose = "1.3.0"
material = "1.13.0" # View-based Material
material3 = "1.4.0"
materialIconsExtended = "1.7.8"

# Google Maps & Places
mapsCompose = "7.0.0"
mapsKtx = "6.0.0"
places = "5.1.1"
androidMapsUtils = "5.0.0"
mapsCompose = "8.4.0"
mapsKtx = "6.2.0"
places = "5.3.0"
playServicesMaps = "20.0.0"
secretsGradlePlugin = "2.0.1"

# Wear OS
wear = "1.3.0"
wear = "1.4.0"
wearable = "2.9.0"

# Dependency Injection
dagger = "2.57.2"
hilt = "2.57.2"
dagger = "2.57.1"

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of com.google.dagger:dagger than 2.57.1 is available: 2.60.1
hilt = "2.57.1"

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of com.google.dagger.hilt.android than 2.57.1 is available: 2.60.1

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of com.google.dagger:hilt-android than 2.57.1 is available: 2.60.1

Check warning

Code scanning / Android Lint

Newer Library Versions Available Warning

A newer version of com.google.dagger:hilt-android-compiler than 2.57.1 is available: 2.60.1

# Testing
espresso = "3.7.0"
junit = "4.13.2"
mockito = "6.2.2"
mockito = "6.3.0"
robolectric = "4.16.1"
truth = "1.4.5"
turbine = "1.2.1"
uiautomator = "2.3.0"
uiautomator = "2.4.0"

# Firebase
firebaseBom = "34.8.0"
Expand All @@ -82,6 +83,8 @@
constraintlayout = { group = "androidx.constraintlayout", name = "constraintlayout", version.ref = "constraintlayout" }
core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
multidex = { group = "androidx.multidex", name = "multidex", version.ref = "multidex" }
navigation-fragment-ktx = { group = "androidx.navigation", name = "navigation-fragment-ktx", version.ref = "navigation" }
navigation-ui-ktx = { group = "androidx.navigation", name = "navigation-ui-ktx", version.ref = "navigation" }
Expand Down
3 changes: 1 addition & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-9.4.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
Expand Down
1 change: 1 addition & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ pluginManagement {
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.PREFER_SETTINGS)
repositories {
mavenLocal()
google()
mavenCentral()
}
Expand Down
2 changes: 1 addition & 1 deletion snippets/app-utils-ktx/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ plugins {

android {
namespace = "com.example.app_utils_ktx"
compileSdk = 36
compileSdk = libs.versions.compileSdk.get().toInt()

defaultConfig {
applicationId = "com.example.app_utils_ktx"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,35 +29,11 @@ internal class Clustering {
inner class MyItem(
lat: Double,
lng: Double,
title: String,
snippet: String
override val title: String,
override val snippet: String
) : ClusterItem {

private val position: LatLng
private val title: String
private val snippet: String

override fun getPosition(): LatLng {
return position
}

override fun getTitle(): String {
return title
}

override fun getSnippet(): String {
return snippet
}

override fun getZIndex(): Float {
return 0f
}

init {
position = LatLng(lat, lng)
this.title = title
this.snippet = snippet
}
override val position: LatLng = LatLng(lat, lng)
override val zIndex: Float? = 0f
}
// [END maps_android_utils_clustering_cluster_item]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ internal class GeoJSON {
// [START_EXCLUDE silent]
null
// [END_EXCLUDE]
val layer = GeoJsonLayer(map, geoJsonData)
val layer = GeoJsonLayer(map, geoJsonData!!)
// [END maps_android_util_geojson_add_jsonobject]
}

Expand Down Expand Up @@ -90,10 +90,10 @@ internal class GeoJSON {
// [END maps_android_util_geojson_geometry_click_events]

// [START maps_android_util_geojson_style]
val pointStyle = layer.defaultPointStyle
pointStyle.isDraggable = true
pointStyle.title = "Hello, World!"
pointStyle.snippet = "I am a draggable marker"
val pointStyle = layer.getDefaultPointStyle()
pointStyle.setDraggable(true)
pointStyle.setTitle("Hello, World!")
pointStyle.setSnippet("I am a draggable marker")
// [END maps_android_util_geojson_style]

// [START maps_android_util_geojson_style_specific]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ internal class KML {
// [START_EXCLUDE silent]
null
// [END_EXCLUDE]
val layer = KmlLayer(map, inputStream, context)
val layer = KmlLayer(map, inputStream!!, context)
// [END maps_android_utils_kml_add_input_stream]

// [START maps_android_utils_kml_add_layer]
Expand All @@ -54,21 +54,21 @@ internal class KML {
// [END maps_android_utils_kml_remove_layer]

// [START maps_android_utils_kml_access_containers]
for (containers in layer.containers) {
for (containers in layer.getContainers()) {
// Do something to container
}
// [END maps_android_utils_kml_access_containers]

// [START maps_android_utils_kml_access_placemarks]
for (placemark in layer.placemarks) {
for (placemark in layer.getPlacemarks()) {
// Do something to Placemark
}
// [END maps_android_utils_kml_access_placemarks]

// [START maps_android_utils_kml_access_properties]
for (container in layer.containers) {
for (container in layer.getContainers()) {
if (container.hasProperty("name")) {
Log.i("KML", container.getProperty("name"))
Log.i("KML", container.getProperty("name") ?: "")
}
}
// [END maps_android_utils_kml_access_properties]
Expand All @@ -78,7 +78,7 @@ internal class KML {
layer.setOnFeatureClickListener { feature ->
Log.i(
"KML",
"Feature clicked: " + feature.id
"Feature clicked: " + feature.getId()
)
}
// [END maps_android_utils_kml_click_listener]
Expand All @@ -88,7 +88,7 @@ internal class KML {
fun accessContainers(containers: Iterable<KmlContainer>) {
for (container in containers) {
if (container.hasContainers()) {
accessContainers(container.containers)
accessContainers(container.getContainers())
}
}
} // [END maps_android_utils_kml_access_containers_nested]
Expand Down
Loading