Skip to content

feat: implement View-based Routes samples and Compose Markers styling/collisions#45

Open
dkhawk wants to merge 42 commits into
mainfrom
feat/fillout-missing-samples
Open

feat: implement View-based Routes samples and Compose Markers styling/collisions#45
dkhawk wants to merge 42 commits into
mainfrom
feat/fillout-missing-samples

Conversation

@dkhawk
Copy link
Copy Markdown
Collaborator

@dkhawk dkhawk commented May 21, 2026

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)

  • Created a shared, highly-optimized JVM-compatible RouteEngine.
  • Added custom play/pause vector graphics and standard activity_routes layout.
  • Expose the android-maps-utils polyline decoder (PolyUtil) to both view-based projects.

🧱 View-based Demos (:ApiDemos)

  • Kotlin + Views Routes API: Fully populated RoutesActivity.kt using coroutines to fetch directions, decode routes, and animate a 3D vehicle along the trail.
  • Java + Views Routes API: Fully populated RoutesActivity.java using an ExecutorService background thread and Handler frame loops to animate vehicle progress smoothly at 60fps.
  • Marked Routes API as ✅ Done in both View READMEs.

🚀 Compose Demos (:ComposeDemos:app)

  • Enhanced MarkersActivity.kt to render three robust, styled, and collision-aware markers demonstrating custom pin borders, background colors, custom text/color glyphs, and CollisionBehavior settings.
  • Marked Map Interactions and Markers as ✅ Done in the Compose README.

All modules compile, build, and run successfully.

dkhawk added 30 commits April 22, 2026 11:35
…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.
…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.
@dkhawk dkhawk requested a review from kikoso May 21, 2026 22:57
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()}°"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants