-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Use AndroidView overload which re-uses MapView to improve performance in lazy layouts #436
feat: Use AndroidView overload which re-uses MapView to improve performance in lazy layouts #436
Conversation
merge latest
This will make sure that the underlying MapView is re-used in a LazyColumn (and elsewhere) which will significantly improve scrolling performance in LazyColumn. If this overload isn't used the MapView will be destroyed every time it leaves composition. The MapView will still be destroyed when the parent node leaves the composition.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Hi @philip-segerfast. As far as I read in the documentation, we need to provide a non-null value in the |
Hi @kikoso, it is enough to make Cheers |
Upon further examination, it appears that executing a reset within Some other notes:
The PR is quite ready except for the |
We'll wait until this feature moves out of alpha and doesn't cause crashes before we merge. |
maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt
Outdated
Show resolved
Hide resolved
Hi, @dkhawk! I made the maps pannable in the demo if you first pan them horizontally so that you still can easily scroll the list. Is this enough for you or would you like the maps to completely intercept the touch events from the |
…operty from MapApplier [see desc.] - Wrap MapUpdater parameters inside a MapUpdaterState data class - Remove MapClickListeners property from MapApplier - Pass MapClickListeners directly to MapClickListenerUpdater
maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt
Outdated
Show resolved
Hide resolved
maps-compose/src/main/java/com/google/maps/android/compose/GoogleMap.kt
Outdated
Show resolved
Hide resolved
@dkhawk friendly reminder about this PR (current 6.0.0 :) ) Also, we often use |
Surely! |
Great job! We will also benefit greatly if this PR gets merged soon so looking forward to it. 👏🏼 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! This should bring some improvements in terms of performance.
Co-authored-by: Enrique López Mañas <[email protected]>
@philip-segerfast this is a great change. Thanks so much for your contribution. |
Thanks, you're all welcome! |
🎉 This issue has been resolved in version 6.1.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Local tests show great results! Thank you very much, @philip-segerfast |
Many thanks to @bubenheimer for reviewing and helping so much too! |
This PR uses an
AndroidView
overload which allows re-using of the underlying view. This improves performance substantially when usingGoogleMap
in a Lazy layout, likeLazyColumn
.This PR also incorporates @bubenheimer's changes from #522.
Fixes #285, #492 🦕