diff --git a/demo/build.gradle.kts b/demo/build.gradle.kts index e2c64060b..16baebf16 100644 --- a/demo/build.gradle.kts +++ b/demo/build.gradle.kts @@ -1,5 +1,5 @@ /** - * Copyright 2024 Google Inc. + * Copyright 2025 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -65,6 +65,7 @@ dependencies { implementation(libs.kotlinx.coroutines.android) implementation(libs.kotlinx.coroutines.core) implementation(libs.material) + implementation(libs.core.ktx) testImplementation(libs.junit) testImplementation(libs.truth) diff --git a/demo/src/main/AndroidManifest.xml b/demo/src/main/AndroidManifest.xml index b1b387dce..fcf52fa22 100644 --- a/demo/src/main/AndroidManifest.xml +++ b/demo/src/main/AndroidManifest.xml @@ -1,5 +1,5 @@ + + + + + + + diff --git a/demo/src/main/res/values/styles.xml b/demo/src/main/res/values/styles.xml index b26d61819..e6a9deae1 100644 --- a/demo/src/main/res/values/styles.xml +++ b/demo/src/main/res/values/styles.xml @@ -1,26 +1,34 @@ + - diff --git a/library/src/main/java/com/google/maps/android/heatmaps/HeatmapTileProvider.kt b/library/src/main/java/com/google/maps/android/heatmaps/HeatmapTileProvider.kt index ba172423e..1ee1731e1 100644 --- a/library/src/main/java/com/google/maps/android/heatmaps/HeatmapTileProvider.kt +++ b/library/src/main/java/com/google/maps/android/heatmaps/HeatmapTileProvider.kt @@ -138,7 +138,7 @@ class HeatmapTileProvider private constructor(builder: Builder) : TileProvider { * @return A new HeatmapTileProvider. */ fun build(): HeatmapTileProvider { - check(this.weightedData?.isNotEmpty() == true) { "No input data: you must use either .data or .weightedData before building." } + require(this.weightedData?.isNotEmpty() == true) { "No input data: you must use either .data or .weightedData before building." } return HeatmapTileProvider(this) } } @@ -423,4 +423,4 @@ class HeatmapTileProvider private constructor(builder: Builder) : TileProvider { return buckets.values.maxOrNull() ?: 0.0 } } -} +} \ No newline at end of file diff --git a/library/src/test/java/com/google/maps/android/heatmaps/HeatmapTileProviderTest.kt b/library/src/test/java/com/google/maps/android/heatmaps/HeatmapTileProviderTest.kt index ccde0afbc..327bbb54e 100644 --- a/library/src/test/java/com/google/maps/android/heatmaps/HeatmapTileProviderTest.kt +++ b/library/src/test/java/com/google/maps/android/heatmaps/HeatmapTileProviderTest.kt @@ -46,7 +46,7 @@ class HeatmapTileProviderTest { try { HeatmapTileProvider.Builder().build() fail("Should have thrown IllegalStateException") - } catch (e: IllegalStateException) { + } catch (_: IllegalArgumentException) { // success } } @@ -56,7 +56,7 @@ class HeatmapTileProviderTest { try { HeatmapTileProvider.Builder().data(emptyList()) fail("Should have thrown IllegalArgumentException") - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { // success } } @@ -74,13 +74,13 @@ class HeatmapTileProviderTest { try { HeatmapTileProvider.Builder().data(data).radius(0) fail("Should have thrown IllegalArgumentException") - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { // success } try { HeatmapTileProvider.Builder().data(data).radius(100) fail("Should have thrown IllegalArgumentException") - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { // success } } @@ -98,13 +98,13 @@ class HeatmapTileProviderTest { try { HeatmapTileProvider.Builder().data(data).opacity(-1.0) fail("Should have thrown IllegalArgumentException") - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { // success } try { HeatmapTileProvider.Builder().data(data).opacity(2.0) fail("Should have thrown IllegalArgumentException") - } catch (e: IllegalArgumentException) { + } catch (_: IllegalArgumentException) { // success } }