feat(flow): add Kotlin Flow extensions for LocationManager and shape managers#391
Open
dkhawk wants to merge 1 commit into
Open
feat(flow): add Kotlin Flow extensions for LocationManager and shape managers#391dkhawk wants to merge 1 commit into
dkhawk wants to merge 1 commit into
Conversation
b1dd995 to
fe2033d
Compare
fe2033d to
906f3c5
Compare
8a52879 to
dfda77e
Compare
There was a problem hiding this comment.
Android Lint found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
1dc0db4 to
998ee05
Compare
…atalog demo app, and screen recording visual automation - Core KTX Flow Extensions: Added cold, lifecycle-aware flows for LocationManager (fineLocationEvents/coarseLocationEvents), shape managers, and ClusterManager clicks, fully covered by unit tests. - Snippets Catalog Demo App: Overhauled the app into a Material 3 card category list menu routing dynamically to immersive notch-safe snippet execution views. - Advanced Telemetry HUD Previews: Added translucent telemetry HUD overlays and polyline path plotting to visually demonstrate sequential coordinate updates for Fine (London) and Coarse (Paris) location flows. - Video Recording to GIF: Added support for capturing smooth, high-quality animation previews (like camera_animation_golden.gif) using screenrecord and host-side ffmpeg. - Gemini AI Visual Verification: Integrated a Gemini AI-driven screenshot verification test framework against goldens to protect snippets from layout regressions. TAG=agy CONV=643f8ea1-f064-41ca-87cd-2fdb73ee13bf
998ee05 to
68819f3
Compare
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.
This PR introduces comprehensive Kotlin Flow extensions to the
maps-utils-ktxlibrary, adding modern reactive APIs for shape collections,ClusterManager, and device location tracking.All changes are fully backward-compatible and verified with robust unit/integration tests.
1. Fused & Device Location Flow Tracking 🗺️📍
Exposed two subscriber-driven Flow APIs on
LocationManagerfor streaming coordinates:coarseLocationEvents(): Streams coarse WiFi/Cell coordinates (NETWORK_PROVIDERwith fallback toPASSIVE_PROVIDER) under@RequiresPermission(Manifest.permission.ACCESS_COARSE_LOCATION).fineLocationEvents(): Streams precise satellite coordinates (GPS_PROVIDER) under@RequiresPermission(Manifest.permission.ACCESS_FINE_LOCATION).removeUpdates) immediately when collectors cancel or close, eliminating memory leaks.CancellationExceptionif the user disables location providers (GPS/Network) mid-collection in Android Settings.LocationListenerto ensure seamless execution onminSdkVersion 23.2. Shape Collection & Cluster Flow Extensions 📦
Added clean Flow wrappers for all listener callbacks in managers:
ClusterManager:clusterClickEvents(),clusterItemClickEvents(),clusterInfoWindowClickEvents(),clusterInfoWindowLongClickEvents(),clusterItemInfoWindowClickEvents(), andclusterItemInfoWindowLongClickEvents().clickEvents()toMarkerManager.Collection(including info window click/long-click flows),PolylineManager.Collection,PolygonManager.Collection,CircleManager.Collection, andGroundOverlayManager.Collection.addPolylineandaddPolygoninline helper extension functions to prevent any breaking regressions.3. Adversarial Unit Tests 🧪
Authored a comprehensive unit test suite in
maps-utils-ktxsimulating concurrent edge-cases:LocationManagerTest.kt: Verifies registration, flow emissions, automatic unregistration, and hardens provider disabled closure (testCoarseLocationProviderDisabled).CollectionManagersTest.kt: Emulates the single-listener slot registration of the Maps SDK to verify that concurrent flow subscribers cleanly hijack and disconnect correctly (testConcurrentCollectionMarkerClick).ClusterManagerTest.kt: Thoroughly tests all 6 clustering flow events.4. Working Samples in Demo App 📱
Updated the sample app
MainActivity.ktandAndroidManifest.xmlto prompt for runtime location permissions and demonstrate live consumption ofLocationManagerflows,ClusterManagerflows, andMarkercollection flows usingrepeatOnLifecyclecollection blocks.Verification Status
🧠 Workspace Assist & Gemini Agentic Skill Package
This PR introduces an ecosystem-standard local Gemini Agentic Skill configuration under the
.gemini/directory. This establishes standard assist guidelines and style rules for theandroid-maps-ktxlibrary to assist developers and autonomous coding assistants.Skill Structure & Guides:
.shareIn()to prevent listener hijacking, and Android 15+ tuner demo mode safety.