googlemaps / googlemaps/android-maps-compose

com.google.maps.android.compose.GoogleMap recomposes when used alongside shared elements that use `.sharedBounds()`

Open
#633 0 comments 0 reactions 0 assignees View on GitHub
priority: p2 type: bug
Dominant language
Kotlin
Stars
1.3k
Forks
181
Avg merge
2d 23h
Merged PRs (30d)
18

Description

Please be sure to include as much information as possible:

#### Environment details

1. OS type and version: `Android 14`
2. Library version:

```
composeMapWidgets = "com.google.maps.android:maps-compose-widgets:3.1.1"
composeMapsUtils = "com.google.maps.android:maps-compose-utils:3.1.1"
composeMaps = "com.google.maps.android:maps-compose:3.1.1"
```

#### Steps to reproduce

1. Replace the value of `com.google.android.geo.API_KEY` in manifest file.
2. Run the app and tap the red box.
3. The box should transition to a second screen and turn into a yellow box spanning whole screen width.
4. Return back to the previous screen by swipe inwards from the left edge or by pressing back button
5. The yellow box transitions back to its original location and transforms into the red box.
6. Notice how the GoogleMap composable flashes and refreshes itself.

https://github.com/user-attachments/assets/3efa9b61-d2cd-443a-8201-feff3bda3c00

###### Expectation

GoogleMap should not recompose or refresh itself when using shared elements transition in Compose

###### Minimal Repro

Here is the link to the [minimal repro](https://drive.google.com/file/d/107xDH1ekEFbkelC-WjUEWb57AgfJQxAX/view?usp=sharing).
Github doesn't allow file size above 25Mb so I couldn't attach the project zip here.

I have also filed a [ticket](https://issuetracker.google.com/issues/371234486) in Google bugtracker as well for the compose animation team to look into.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.