feat: implement View-based Routes samples and Compose Markers styling/collisions#45
Open
dkhawk wants to merge 42 commits into
Open
feat: implement View-based Routes samples and Compose Markers styling/collisions#45dkhawk wants to merge 42 commits into
dkhawk wants to merge 42 commits into
Conversation
…sh UI test baseline - Created a centralized samples catalog at the repository root for better discoverability, integrating the PlacesUIKit3D sample. - Created BasicComposeMapActivity from scratch to serve as a minimal pedagogical reference for Maps 3D Compose integration. - Established a baseline of UI smoke tests across key activities in both advanced and PlacesUIKit3D modules to ensure stability.
Created ComposeDemos module with skeletons, tests, and automation script. Reorganized catalog into module-specific READMEs.
Enabled immersive mode in all implemented activities and updated screenshots in catalog.
Implemented Polygons, Models, and Markers samples in Compose with visual tests and updated catalog.
Implemented Camera Restrictions sample in Compose with visual test and updated catalog.
…log automation - **Java App**: Fix `CameraControlsVisualTest` by searching for "Heading" after UI string update. - **Kotlin App**: Add skeleton activities to `MainActivity` and add `:visual-testing` dependency. - **Common**: Update `camera_state_format` to use "Heading:" instead of "Hdg:" to align with Kotlin. - **Visual Testing**: Add blocking methods to `GeminiVisualTestHelper` for Java interop and update model to `gemini-2.5-pro`. - **Automation**: Update `catalog_automation.py` to save screenshots to `screenshots/` instead of `assets/` to avoid bundling them in the APK. This change brings the Java and Kotlin View samples into better alignment, fixes the failing camera controls test, and improves the automation infrastructure for generating documentation catalogs.
…va and Kotlin Views
…ttern for Java and Kotlin View samples
…tches - Correct Gemini model endpoint configurations in GeminiVisualTestHelper.kt to use gemini-3.5-flash on the v1beta API endpoint for unified visual testing. - Resolve Denver altitude rendering glitch in PolygonsActivity.java by switching from UnitsKt.getMeters(1.0) to UnitsKt.getMiles(1.0), preventing the camera and polygons from rendering deep underground. - Refactor PolygonsActivity.java view lifecycle to utilize the robust delayed initialization fallback pattern for 3D renderer stability. - Align prompts and expectations in MarkersVisualTest (Java and Kotlin) to verify the NYC / Giant Ape / custom pins configuration instead of the outdated Devils Tower setup. - Align prompts and expected text in PopoversVisualTest (Java and Kotlin) to target the Golden Gate Bridge marker and check for its populated popover layout. - Implement standard camera setup in HelloMapActivity.kt at the Delicate Arch to achieve full visual parity with the Java implementation. - Resolve JSON substring extraction bug in PopoversVisualTest.kt by utilizing standard string concatenation. - Integrate explicit setOnMapSteadyListener wait synchronization at the start of CameraControlsActivityTest.testFlyAround to prevent coordinate validation races.
…out-missing-samples
…ne math utilities
…rsActivity and update status
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| app:icon="@drawable/play_arrow_24px" | ||
| android:contentDescription="Play or pause route animation" |
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="8dp" | ||
| android:text="Camera Altitude: 1500m" |
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="4dp" | ||
| android:text="Vehicle Speed: 150m/s" |
| android:layout_width="wrap_content" | ||
| android:layout_height="wrap_content" | ||
| android:layout_marginTop="4dp" | ||
| android:text="Camera Yaw Offset: 0°" |
| } | ||
|
|
||
| // Initialize Slider Labels and Listeners | ||
| rangeSliderLabel.text = "Camera Altitude: ${cameraRange.toInt()}m" |
| } | ||
|
|
||
| // Initialize Slider Labels and Listeners | ||
| rangeSliderLabel.text = "Camera Altitude: ${cameraRange.toInt()}m" |
| rangeSlider.value = cameraRange | ||
| rangeSlider.addOnChangeListener { _, value, _ -> | ||
| cameraRange = value | ||
| rangeSliderLabel.text = "Camera Altitude: ${value.toInt()}m" |
| rangeSlider.value = cameraRange | ||
| rangeSlider.addOnChangeListener { _, value, _ -> | ||
| cameraRange = value | ||
| rangeSliderLabel.text = "Camera Altitude: ${value.toInt()}m" |
| updateVehiclePositionAndCamera() | ||
| } | ||
|
|
||
| speedSliderLabel.text = "Vehicle Speed: ${vehicleSpeedMps.toInt()}m/s" |
| speedSlider.value = vehicleSpeedMps | ||
| speedSlider.addOnChangeListener { _, value, _ -> | ||
| vehicleSpeedMps = value | ||
| speedSliderLabel.text = "Vehicle Speed: ${value.toInt()}m/s" |
| speedSliderLabel.text = "Vehicle Speed: ${value.toInt()}m/s" | ||
| } | ||
|
|
||
| headingSliderLabel.text = "Camera Yaw Offset: ${yawOffset.toInt()}°" |
| speedSliderLabel.text = "Vehicle Speed: ${value.toInt()}m/s" | ||
| } | ||
|
|
||
| headingSliderLabel.text = "Camera Yaw Offset: ${yawOffset.toInt()}°" |
| headingSlider.value = yawOffset | ||
| headingSlider.addOnChangeListener { _, value, _ -> | ||
| yawOffset = value | ||
| headingSliderLabel.text = "Camera Yaw Offset: ${value.toInt()}°" |
| headingSlider.value = yawOffset | ||
| headingSlider.addOnChangeListener { _, value, _ -> | ||
| yawOffset = value | ||
| headingSliderLabel.text = "Camera Yaw Offset: ${value.toInt()}°" |
…st and update manifests and catalogs
…reen for View-based Kotlin/Java RoutesActivity
…and Kotlin RoutesActivity to prevent blank/white map rendering
…ition and orientation in Java and Kotlin
…ity to enable precise vehicle turning
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.
Summary of Changes
Implementing the missing View-based Routes API samples for both Kotlin and Java, while synchronizing the catalogs and enhancing modern Compose Marker features.
📦 Shared Core Module (
:ApiDemos:common)android-maps-utilspolyline decoder (PolyUtil) to both view-based projects.🧱 View-based Demos (
:ApiDemos)RoutesActivity.ktusing coroutines to fetch directions, decode routes, and animate a 3D vehicle along the trail.RoutesActivity.javausing anExecutorServicebackground thread andHandlerframe loops to animate vehicle progress smoothly at 60fps.✅ Donein both View READMEs.🚀 Compose Demos (
:ComposeDemos:app)MarkersActivity.ktto render three robust, styled, and collision-aware markers demonstrating custom pin borders, background colors, custom text/color glyphs, andCollisionBehaviorsettings.✅ Donein the Compose README.All modules compile, build, and run successfully.