Skip to content

Conversation

@dkhawk
Copy link
Collaborator

@dkhawk dkhawk commented Sep 16, 2025

New TileOverlayActivity.kt: This new activity demonstrates the fix to the tile overlays made in #755

This PR should be merged after #768

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.
@dkhawk dkhawk requested a review from kikoso September 16, 2025 23:22
@googlemaps-bot
Copy link
Contributor

Code Coverage

There is no coverage information present for the Files changed

@kikoso kikoso changed the title chore/demo tile overlay state fix chore: demo tile overlay state fix Sep 17, 2025
@kikoso kikoso changed the base branch from main to chore/export-activities September 17, 2025 13:47
@kikoso kikoso requested a review from a team as a code owner September 17, 2025 13:47
@kikoso
Copy link
Collaborator

kikoso commented Sep 17, 2025

@dkhawk , I have changed the base branch to chore/export-activities, to have more clarity on the diff.

Base automatically changed from chore/export-activities to main September 17, 2025 13:50
…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.
@dkhawk dkhawk merged commit e3685c6 into main Sep 17, 2025
10 checks passed
@dkhawk dkhawk deleted the feat/fix-tile-overlay-state branch September 17, 2025 17:21
@googlemaps-bot
Copy link
Contributor

🎉 This PR is included in version 6.11.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@googlemaps-bot
Copy link
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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants