diff --git a/.gemini/config.yaml b/.gemini/config.yaml index 7a05ec4a..770d2c1c 100644 --- a/.gemini/config.yaml +++ b/.gemini/config.yaml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + # Gemini Code Assist Configuration # See: https://developers.google.com/gemini-code-assist/docs/customize-gemini-behavior-github diff --git a/.github/scripts/triage_issue.py b/.github/scripts/triage_issue.py index d9f1c91c..8eb2337b 100644 --- a/.github/scripts/triage_issue.py +++ b/.github/scripts/triage_issue.py @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + import os import json import urllib.request diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 287786e5..6ccf5869 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Publish on: diff --git a/.github/workflows/release-please.yml b/.github/workflows/release-please.yml index 90333827..7a1d629d 100644 --- a/.github/workflows/release-please.yml +++ b/.github/workflows/release-please.yml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + on: push: branches: diff --git a/.github/workflows/triage-issue.yml b/.github/workflows/triage-issue.yml index 79cab122..6217d646 100644 --- a/.github/workflows/triage-issue.yml +++ b/.github/workflows/triage-issue.yml @@ -1,3 +1,17 @@ +# Copyright 2026 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + name: Issue Triage with Gemini on: diff --git a/build-logic/convention/build.gradle.kts b/build-logic/convention/build.gradle.kts index f2399c9b..3a858e40 100644 --- a/build-logic/convention/build.gradle.kts +++ b/build-logic/convention/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + plugins { `kotlin-dsl` } diff --git a/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt b/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt index 8af5773a..3544bc8c 100644 --- a/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt +++ b/build-logic/convention/src/main/kotlin/PublishingConventionPlugin.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // buildSrc/src/main/kotlin/PublishingConventionPlugin.kt import com.vanniktech.maven.publish.AndroidSingleVariantLibrary import com.vanniktech.maven.publish.MavenPublishBaseExtension diff --git a/build-logic/convention/src/main/kotlin/dokka-convention.gradle.kts b/build-logic/convention/src/main/kotlin/dokka-convention.gradle.kts index 04446396..55785d9e 100644 --- a/build-logic/convention/src/main/kotlin/dokka-convention.gradle.kts +++ b/build-logic/convention/src/main/kotlin/dokka-convention.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + /** * Common conventions for generating documentation with Dokka. */ diff --git a/build-logic/settings.gradle.kts b/build-logic/settings.gradle.kts index 2907fbfb..a2af1303 100644 --- a/build-logic/settings.gradle.kts +++ b/build-logic/settings.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + dependencyResolutionManagement { repositories { google() diff --git a/build.gradle.kts b/build.gradle.kts index a310dae0..60f84950 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { diff --git a/docs/build.gradle.kts b/docs/build.gradle.kts index c0727f4f..0d4c3c4a 100644 --- a/docs/build.gradle.kts +++ b/docs/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + plugins { kotlin("jvm") apply false id("org.jetbrains.dokka") diff --git a/maps-app/build.gradle.kts b/maps-app/build.gradle.kts index 0654b784..1a6b6c1b 100644 --- a/maps-app/build.gradle.kts +++ b/maps-app/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { diff --git a/maps-app/src/androidTest/AndroidManifest.xml b/maps-app/src/androidTest/AndroidManifest.xml index 6fae52d7..0e2e2c41 100644 --- a/maps-app/src/androidTest/AndroidManifest.xml +++ b/maps-app/src/androidTest/AndroidManifest.xml @@ -1,4 +1,20 @@ + + diff --git a/maps-app/src/androidTest/java/com/google/maps/android/compose/MapsInLazyColumnTest.kt b/maps-app/src/androidTest/java/com/google/maps/android/compose/MapsInLazyColumnTest.kt index dcb21547..7ec24aff 100644 --- a/maps-app/src/androidTest/java/com/google/maps/android/compose/MapsInLazyColumnTest.kt +++ b/maps-app/src/androidTest/java/com/google/maps/android/compose/MapsInLazyColumnTest.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.compose.foundation.lazy.rememberLazyListState diff --git a/maps-app/src/androidTest/java/com/google/maps/android/compose/StreetViewTests.kt b/maps-app/src/androidTest/java/com/google/maps/android/compose/StreetViewTests.kt index 2f73f800..ed5b3fc3 100644 --- a/maps-app/src/androidTest/java/com/google/maps/android/compose/StreetViewTests.kt +++ b/maps-app/src/androidTest/java/com/google/maps/android/compose/StreetViewTests.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.compose.ui.Modifier diff --git a/maps-app/src/androidTest/java/com/google/maps/android/compose/TestUtils.kt b/maps-app/src/androidTest/java/com/google/maps/android/compose/TestUtils.kt index 5d45ac54..e9b74f01 100644 --- a/maps-app/src/androidTest/java/com/google/maps/android/compose/TestUtils.kt +++ b/maps-app/src/androidTest/java/com/google/maps/android/compose/TestUtils.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import com.google.android.gms.maps.model.LatLng diff --git a/maps-app/src/main/AndroidManifest.xml b/maps-app/src/main/AndroidManifest.xml index 9d0cdc44..a8922937 100644 --- a/maps-app/src/main/AndroidManifest.xml +++ b/maps-app/src/main/AndroidManifest.xml @@ -64,6 +64,9 @@ + diff --git a/maps-app/src/main/java/com/google/maps/android/compose/Demo.kt b/maps-app/src/main/java/com/google/maps/android/compose/Demo.kt index 410785c7..45925c82 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/Demo.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/Demo.kt @@ -75,6 +75,11 @@ sealed class ActivityGroup( R.string.basic_map_activity_description, BasicMapActivity::class ), + Activity( + R.string.lite_mode_activity, + R.string.lite_mode_activity_description, + LiteModeActivity::class + ), Activity( R.string.street_view_activity, R.string.street_view_activity_description, diff --git a/maps-app/src/main/java/com/google/maps/android/compose/FragmentDemoActivity.kt b/maps-app/src/main/java/com/google/maps/android/compose/FragmentDemoActivity.kt index 0caaf178..bc9c1c43 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/FragmentDemoActivity.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/FragmentDemoActivity.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose diff --git a/maps-app/src/main/java/com/google/maps/android/compose/GoogleMapComposeFragment.kt b/maps-app/src/main/java/com/google/maps/android/compose/GoogleMapComposeFragment.kt index fde1cdc8..19c5248b 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/GoogleMapComposeFragment.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/GoogleMapComposeFragment.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import android.os.Bundle diff --git a/maps-app/src/main/java/com/google/maps/android/compose/LiteModeActivity.kt b/maps-app/src/main/java/com/google/maps/android/compose/LiteModeActivity.kt new file mode 100644 index 00000000..3d626304 --- /dev/null +++ b/maps-app/src/main/java/com/google/maps/android/compose/LiteModeActivity.kt @@ -0,0 +1,95 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package com.google.maps.android.compose + +import android.os.Bundle +import androidx.activity.ComponentActivity +import androidx.activity.compose.setContent +import androidx.activity.enableEdgeToEdge +import androidx.compose.foundation.layout.Box +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.systemBarsPadding +import androidx.compose.material3.Button +import androidx.compose.material3.Text +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.rememberCoroutineScope +import androidx.compose.ui.Modifier +import androidx.compose.ui.unit.dp +import com.google.android.gms.maps.CameraUpdateFactory +import com.google.android.gms.maps.GoogleMapOptions +import com.google.android.gms.maps.model.CameraPosition +import com.google.android.gms.maps.model.LatLng +import com.google.maps.android.compose.theme.MapsComposeSampleTheme +import kotlinx.coroutines.launch + +class LiteModeActivity : ComponentActivity() { + + override fun onCreate(savedInstanceState: Bundle?) { + super.onCreate(savedInstanceState) + enableEdgeToEdge() + setContent { + MapsComposeSampleTheme { + val singapore = remember { LatLng(1.35, 103.87) } + val tokyo = remember { LatLng(35.6895, 139.6917) } + val coroutineScope = rememberCoroutineScope() + val cameraPositionState = rememberCameraPositionState { + position = CameraPosition.fromLatLngZoom(singapore, 11f) + } + val mapProperties by remember { + mutableStateOf(MapProperties(mapType = MapType.NORMAL)) + } + + Column( + modifier = Modifier.fillMaxSize().systemBarsPadding() + ) { + Button( + onClick = { + coroutineScope.launch { + // This would previously hang indefinitely in Lite Mode! + // Now it falls back to instantaneous movement and completes the coroutine. + val newTarget = if (cameraPositionState.position.target == singapore) { + tokyo + } else { + singapore + } + cameraPositionState.animate(CameraUpdateFactory.newLatLng(newTarget)) + } + }, + modifier = Modifier.padding(16.dp) + ) { + Text("Animate Camera (Tests Fix)") + } + + Box( + modifier = Modifier.weight(1f), + ) { + GoogleMap( + modifier = Modifier.matchParentSize(), + googleMapOptionsFactory = { GoogleMapOptions().liteMode(true) }, + cameraPositionState = cameraPositionState, + properties = mapProperties, + ) + } + } + } + } + } +} diff --git a/maps-app/src/main/java/com/google/maps/android/compose/MapFragmentPagerAdapter.kt b/maps-app/src/main/java/com/google/maps/android/compose/MapFragmentPagerAdapter.kt index cb2cd092..26bc818d 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/MapFragmentPagerAdapter.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/MapFragmentPagerAdapter.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.fragment.app.Fragment diff --git a/maps-app/src/main/java/com/google/maps/android/compose/MapsInLazyColumnActivity.kt b/maps-app/src/main/java/com/google/maps/android/compose/MapsInLazyColumnActivity.kt index eb507a1b..f251fea3 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/MapsInLazyColumnActivity.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/MapsInLazyColumnActivity.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import android.os.Bundle diff --git a/maps-app/src/main/java/com/google/maps/android/compose/TileOverlayActivity.kt b/maps-app/src/main/java/com/google/maps/android/compose/TileOverlayActivity.kt index 5f531cfc..9f7976a1 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/TileOverlayActivity.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/TileOverlayActivity.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import android.graphics.Bitmap diff --git a/maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt b/maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt index fe82f5ca..53947426 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.markerexamples import android.os.Bundle diff --git a/maps-app/src/main/java/com/google/maps/android/compose/theme/Theme.kt b/maps-app/src/main/java/com/google/maps/android/compose/theme/Theme.kt index d1274f5d..cf09587c 100644 --- a/maps-app/src/main/java/com/google/maps/android/compose/theme/Theme.kt +++ b/maps-app/src/main/java/com/google/maps/android/compose/theme/Theme.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.theme import androidx.compose.foundation.isSystemInDarkTheme diff --git a/maps-app/src/main/res/layout/activity_fragment_demo.xml b/maps-app/src/main/res/layout/activity_fragment_demo.xml index 5620f3cd..36cbe1d0 100644 --- a/maps-app/src/main/res/layout/activity_fragment_demo.xml +++ b/maps-app/src/main/res/layout/activity_fragment_demo.xml @@ -1,4 +1,20 @@ + + Basic Map A simple map showing the default configuration. + Lite Mode Map + A map showcasing the Lite Mode configuration. + Street View A simple Street View. diff --git a/maps-app/src/screenshotTest/AndroidManifest.xml b/maps-app/src/screenshotTest/AndroidManifest.xml index e366e537..43c44f09 100644 --- a/maps-app/src/screenshotTest/AndroidManifest.xml +++ b/maps-app/src/screenshotTest/AndroidManifest.xml @@ -1,4 +1,20 @@ + + { val unclusteredItems: State> @@ -63,6 +83,13 @@ internal class ComposeUiClusterRenderer( private val fakeCanvas = Canvas() private val keysToViews = mutableMapOf, ViewInfo>() + private val fakeLifecycleOwner = object : LifecycleOwner { + private val lifecycleRegistry = LifecycleRegistry(this).apply { + currentState = Lifecycle.State.RESUMED + } + override val lifecycle: Lifecycle get() = lifecycleRegistry + } + override fun onClustersChanged(clusters: Set>) { super.onClustersChanged(clusters) unclusteredItems.value = clusters.filter { !shouldRenderAsCluster(it) } @@ -121,6 +148,7 @@ internal class ComposeUiClusterRenderer( } } ) + view.setViewTreeLifecycleOwner(fakeLifecycleOwner) val renderHandle = viewRendererState.value.startRenderingView(view) val rerenderJob = scope.launch { collectInvalidationsAndRerender(key, view) diff --git a/maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering/Clustering.kt b/maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering/Clustering.kt index 482dfc40..741d0ac5 100644 --- a/maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering/Clustering.kt +++ b/maps-compose-utils/src/main/java/com/google/maps/android/compose/clustering/Clustering.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.clustering import android.content.Context diff --git a/maps-compose-widgets/build.gradle.kts b/maps-compose-widgets/build.gradle.kts index 5f4efed6..cc6e33f4 100644 --- a/maps-compose-widgets/build.gradle.kts +++ b/maps-compose-widgets/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { diff --git a/maps-compose-widgets/src/androidTest/java/com/google/maps/android/compose/ScaleBarUnitTest.kt b/maps-compose-widgets/src/androidTest/java/com/google/maps/android/compose/ScaleBarUnitTest.kt index 8ac332fe..3a1843e8 100644 --- a/maps-compose-widgets/src/androidTest/java/com/google/maps/android/compose/ScaleBarUnitTest.kt +++ b/maps-compose-widgets/src/androidTest/java/com/google/maps/android/compose/ScaleBarUnitTest.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.widgets diff --git a/maps-compose/build.gradle.kts b/maps-compose/build.gradle.kts index 54139092..d9b175a7 100644 --- a/maps-compose/build.gradle.kts +++ b/maps-compose/build.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + import org.jetbrains.kotlin.gradle.dsl.JvmTarget plugins { diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/CameraPositionState.kt b/maps-compose/src/main/java/com/google/maps/android/compose/CameraPositionState.kt index e6e9096c..f0be881e 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/CameraPositionState.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/CameraPositionState.kt @@ -87,6 +87,8 @@ public inline fun rememberCameraPositionState( public class CameraPositionState private constructor( position: CameraPosition = CameraPosition(LatLng(0.0, 0.0), 0f, 0f, 0f) ) { + internal var isLiteMode: Boolean = false + /** * Whether the camera is currently moving or not. This includes any kind of movement: * panning, zooming, or rotation. @@ -281,6 +283,12 @@ public class CameraPositionState private constructor( durationMs: Int, continuation: CancellableContinuation ) { + if (isLiteMode) { + map.moveCamera(update) + continuation.resume(Unit) + return + } + val cancelableCallback = object : GoogleMap.CancelableCallback { override fun onCancel() { continuation.resumeWithException(CancellationException("Animation cancelled")) diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt index d0266903..0e3d833b 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt @@ -154,7 +154,9 @@ public fun GoogleMap( AndroidView( modifier = modifier, factory = { context -> - mapViewFactory(context, googleMapOptionsFactory()).also { mapView -> + val options = googleMapOptionsFactory() + cameraPositionState.isLiteMode = options.liteMode == true + mapViewFactory(context, options).also { mapView -> val componentCallbacks = object : ComponentCallbacks2 { override fun onConfigurationChanged(newConfig: Configuration) {} diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMapComposable.kt b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMapComposable.kt index 56f3f04c..9c88fd46 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMapComposable.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/GoogleMapComposable.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.compose.runtime.ComposableTargetMarker diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/InputHandler.kt b/maps-compose/src/main/java/com/google/maps/android/compose/InputHandler.kt index a6bbda2b..62b3cf8d 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/InputHandler.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/InputHandler.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.annotation.RestrictTo diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/MapComposeViewRender.kt b/maps-compose/src/main/java/com/google/maps/android/compose/MapComposeViewRender.kt index 8e1fa5ad..a66c8417 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/MapComposeViewRender.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/MapComposeViewRender.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import android.content.Context diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/MapEffect.kt b/maps-compose/src/main/java/com/google/maps/android/compose/MapEffect.kt index 6cac92b7..e399dcfa 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/MapEffect.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/MapEffect.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.compose.runtime.Composable diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/MapsComposeExperimentalApi.kt b/maps-compose/src/main/java/com/google/maps/android/compose/MapsComposeExperimentalApi.kt index 41949f85..ad881908 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/MapsComposeExperimentalApi.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/MapsComposeExperimentalApi.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose /** diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/ReattachClickListeners.kt b/maps-compose/src/main/java/com/google/maps/android/compose/ReattachClickListeners.kt index e33586f2..2f3b7b5f 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/ReattachClickListeners.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/ReattachClickListeners.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import androidx.annotation.RestrictTo diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/RememberComposeBitmapDescriptor.kt b/maps-compose/src/main/java/com/google/maps/android/compose/RememberComposeBitmapDescriptor.kt index 2c24c385..98332b76 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/RememberComposeBitmapDescriptor.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/RememberComposeBitmapDescriptor.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose import android.view.View diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt index cf3607d2..b062f84b 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewCameraPositionState.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.streetview import androidx.compose.runtime.Composable diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaApplier.kt b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaApplier.kt index 18f69286..c5676f8c 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaApplier.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaApplier.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.streetview import androidx.compose.runtime.AbstractApplier diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaEventListeners.kt b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaEventListeners.kt index 7b15e6b9..1793631a 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaEventListeners.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaEventListeners.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.streetview import androidx.compose.runtime.getValue diff --git a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaUpdater.kt b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaUpdater.kt index 2898ec8f..f9b2caf4 100644 --- a/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaUpdater.kt +++ b/maps-compose/src/main/java/com/google/maps/android/compose/streetview/StreetViewPanoramaUpdater.kt @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + package com.google.maps.android.compose.streetview import androidx.compose.runtime.Composable diff --git a/maps-compose/src/main/res/values/ids.xml b/maps-compose/src/main/res/values/ids.xml index 10f586d6..cd8acd3e 100644 --- a/maps-compose/src/main/res/values/ids.xml +++ b/maps-compose/src/main/res/values/ids.xml @@ -1,4 +1,20 @@ + + diff --git a/settings.gradle.kts b/settings.gradle.kts index 3366f3c6..9a99af41 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -1,3 +1,19 @@ +/* + * Copyright 2026 Google LLC + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + dependencyResolutionManagement { repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS) repositories {