Repository navigation
Conversation
- StreetViewPanoramaUpdater: take the listener parameters as nullable instead of using safe calls on non-null types, keeping the null guard. - StreetView: use androidx.lifecycle.compose.LocalLifecycleOwner, like GoogleMap already does. - MarkerComposable: opt in to MapsComposeExperimentalApi where it uses rememberComposeBitmapDescriptor. - The deprecated rememberCameraPositionState(key) and rememberMarkerState(key) overloads keep forwarding the key; suppress the deprecation there instead of silently dropping it. With no warnings left, maps-compose, maps-compose-utils and maps-compose-widgets now compile with allWarningsAsErrors.
Coverage (unit tests)Compared against
Line and branch coverage from unit test reports. History is recorded on the |
Contributor
Coverage (instrumentation tests)
Files
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The three library modules compile with seven warnings today. Some of them are deprecations that will turn into errors in a future Compose or Lifecycle release, and nothing stops new ones from piling up. This fixes all of them and turns on
allWarningsAsErrorsformaps-compose,maps-compose-utilsandmaps-compose-widgets, so the next deprecation fails the build when it appears instead of being found during an upgrade.StreetViewPanoramaUpdater: the camera and location listeners used?.on parameters the compiler sees as non-null. The guard is intentional (GMS can deliver null), so instead of dropping it, the lambdas now take the parameter as nullable (camera: StreetViewPanoramaCamera?). Same behaviour, no warning.StreetView:androidx.compose.ui.platform.LocalLifecycleOwneris deprecated in favour ofandroidx.lifecycle.compose.LocalLifecycleOwner, whichGoogleMapalready uses. It is the same composition local, and no new dependency is needed.MarkerComposable: it calls our own experimentalrememberComposeBitmapDescriptor, so the two call sites now@OptIn(MapsComposeExperimentalApi::class). Apps calling it directly still get the warning.rememberCameraPositionState(key)andrememberMarkerState(key): both overloads are already deprecated and exist to pass a customkeytorememberSaveable, which is itself deprecated now. They keep forwarding the key and suppress the deprecation, with a comment. Dropping the key instead would silently change behaviour for apps still calling them; this is the same question as in perf(clustering): use a Set for cluster view key diffing and suppress rememberSaveable key deprecation #983, which I think should go this way too.No public API or behaviour change.
Testing
compileReleaseKotlinwith--rerun-tasks)../gradlew buildwith every task re-run (compile, unit tests, lint) andassembleDebugAndroidTestfor the three libraries pass.maps-compose-widgetsfails the build withwarnings found and -Werror specified.spotlessKotlinCheckpasses.maps-appstill has deprecation warnings (mostly the oldcreateComposeRule); that one is in a separate PR, and the setting is only enabled for the libraries.