-
Notifications
You must be signed in to change notification settings - Fork 170
chore: demo tile overlay state fix #769
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
Merged
Merged
Conversation
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
Updated the `AndroidManifest.xml` in the `maps-app` sample to set `android:exported="true"` for all sample activities. This change allows each activity to be launched directly, simplifying demonstration and testing.
To make the main screen less cluttered and easier to navigate, the demo activities have been grouped into a list. This provides a cleaner and more organized user experience. This change also pulls in Material 3.
This commit updates the main screen to use a Material 3 Scaffold, providing a more modern and consistent layout. The TopAppBar has also been updated to be center-aligned.
Refactored the demo list screen to support internationalization by extracting all hardcoded strings into `strings.xml`. The `Activity` and `ActivityGroup` data classes were updated to use `@StringRes` integer IDs instead of `String` literals. Additionally, the `DemoList` composable has been broken down into smaller, more focused composables (`GroupHeaderItem` and `DemoActivityItem`) to improve readability and maintainability.
This commit introduces a new example activity, `TileOverlayActivity`, to demonstrate the usage and dynamic updating of the `TileOverlay` composable. The demo showcases: - Providing custom tiles using a `TileProvider`. - Refreshing tile content by calling `clearTileCache()` on the `TileOverlayState`. The example updates tiles every second to display an incrementing number. - Replacing the `TileProvider` instance to trigger a full refresh of the overlay. The new activity is registered in the manifest and is accessible from the main screen of the demo application.
The TileOverlayActivity was previously launched from a standalone button in MainActivity. This commit moves it into the "Map Features" group within Demo.kt, ensuring a more consistent and organized user experience. This change also removes the now-redundant button from MainActivity.
Contributor
Code Coverage
|
Collaborator
|
@dkhawk , I have changed the base branch to |
kikoso
reviewed
Sep 17, 2025
maps-app/src/main/java/com/google/maps/android/compose/TileOverlayActivity.kt
Outdated
Show resolved
Hide resolved
…better demonstrate how to update a `TileOverlay`. The `LaunchedEffect` in `TileOverlayDemo` now includes comments explaining two distinct update strategies: 1. **Cache Invalidation**: Calling `state.clearTileCache()` to force a redraw of tiles using the existing `TileProvider`. 2. **Provider Replacement**: Creating a new `TileProvider` instance, which triggers a full replacement of the overlay's data source.
Contributor
|
🎉 This PR is included in version 6.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
Contributor
|
🎉 This PR is included in version 6.11.0 🎉 The release is available on:
Your semantic-release bot 📦🚀 |
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.
New
TileOverlayActivity.kt: This new activity demonstrates the fix to the tile overlays made in #755This PR should be merged after #768