Skip to content

fix(codelab): align starter, solution, and codelab.md; add framed screenshots and immersive mode - #96

Draft
dkhawk wants to merge 1 commit into
mainfrom
fix/codelab-audit
Draft

dkhawk wants to merge 1 commit into
mainfrom
fix/codelab-audit

Conversation

@dkhawk

@dkhawk dkhawk commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

Summary

This PR resolves findings from a comprehensive audit of the Aloha Explorer 3D Maps Codelab (codelab/codelab.md, codelab/starter, and codelab/solution) introduced in #36:

1. Codelab Text (codelab/codelab.md) & Screenshots (codelab/images/)

  • All 10 Framed Codelab Screenshots: Replaced all 5 <!-- TODO: Add screenshot here --> placeholders and captured/framed screenshots in the repo's 608x1281 Pixel 6 device frame (in System UI Demo Mode + Sticky Immersive Mode) across all 10 visual steps:
    • Step 1.3 (global_view.png), Step 3 (fly_to_honolulu.png), Step 4 (four_markers.png), Step 5 (custom_markers.png), Step 6 (extruded_palace.png), Step 8 (polylines.png), Step 9 (balloon_model.png), Step 10 (popover_example.png), Step 11 (scenic_tour.png), and Step 12 (compose_integration.png).
  • Complete Step-by-Step Code:
    • Step 1.2: Documented Sticky Immersive Mode (WindowInsetsControllerCompat.BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE) with a > [!TIP] callout and inline comments showing which 3 lines to remove if persistent system bars are preferred.
    • Step 3 (flyToHonolulu): Replaced { ... } ellipses with the complete flyToOptions and flyAroundOptions implementation.
    • Step 6 & 7 (addPolygon): Added the full addPolygon method (resetMap(), map.addPolygon(polygonOptions { ... }), activePolygons.add(face), and click listener attachment) and fixed extrudePolygon visibility in Utilities.kt.
    • Step 8 (setupPolylines) & Step 9 (setupBalloon): Added enclosing function signatures, resetMap(), and activeModels.add(balloon).
    • Step 11 (flyTour Challenge): Fixed the broken awaitCameraAnimation(map) hint to match the 5-step coroutine sequence (camera, flyCameraToAndWait, awaitMapSteady, flyAroundOptions, delay) and added a collapsible <details> solution block.
    • Step 12 (Map3DComposeActivity): Added AndroidManifest.xml instructions and updated Map3DInitConfig.create(...).
  • Updated the Google Cloud Console link to maps3d.googleapis.com, formatted alerts using GitHub Flavored Markdown (> [!NOTE] / > [!TIP]), and added a link to codelab/ in the root README.md.

2. Starter & Solution Parity (codelab/starter & codelab/solution)

  • Sequential Method Ordering: Reordered solution/.../MainActivity.kt sequentially from Step 1 to Step 11 to match starter/.../MainActivity.kt and codelab.md.
  • Compose Starter Skeleton & Crash Fix:
    • Converted starter/.../Map3DComposeActivity.kt from a commented-out full solution into a compiling skeleton with step-by-step TODO hints.
    • Replaced Map3DInitConfig.create().copy(...) (which threw java.lang.NoSuchMethodError: No static method copy$default at runtime due to R8 obfuscation in play-services-maps3d:16.0.1) with Map3DInitConfig.create(...).
  • Full-Bleed Sticky Immersive Mode: Configured WindowInsetsControllerCompat in MainActivity.kt and Map3DComposeActivity.kt and removed top system-bar padding on map3dView / Map3DContainer so the 3D TextureView renders full-bleed to the top edge (y = 0).
  • Camera & Coordinate Fixes (HonoluluData.kt):
    • Added POLYLINE_CAMERA (used by btn_show_polylines) to frame the full geodesic polyline between Iolani Palace and Waikiki Beach.
    • Updated PEARL_HARBOR coordinates from 21.31861, -157.92250 (Honolulu Airport runway) to 21.3649, -157.9500 (Pearl Harbor / USS Arizona Memorial).
  • Resource & Test Cleanup:
    • Replaced the 2.4 KB JPEG-disguised-as-PNG starter/.../drawable-nodpi/hibiscus.png with the valid 38 KB PNG from solution.
    • Removed unused solution/.../drawable/controls_background.xml, deduplicated strings.xml, externalized the 7 tour landmark strings, and added extrudePolygon unit tests to solution/.../ExampleUnitTest.kt.

Test Plan

  • Verified ./gradlew assembleDebug testDebugUnitTest passes in both codelab/starter and codelab/solution.
  • Installed and verified all 12 steps (MainActivity and Map3DComposeActivity) on a physical Pixel 6 device.
…eenshots and immersive mode

- Align `codelab/starter` and `codelab/solution` sequentially from Step 1 to Step 12 so `diff(starter, solution)` is clean and predictable
- Expand `codelab/codelab.md` with complete code blocks for `flyToHonolulu`, `addPolygon`, `setupPolylines`, `setupBalloon`, `flyTour` (with 5-step hints and a collapsible `<details>` solution), and `Map3DComposeActivity`
- Convert `starter/.../Map3DComposeActivity.kt` into a compiling skeleton with step-by-step `TODO` hints
- Fix `NoSuchMethodError: copy$default` crash in `Map3DComposeActivity.kt` by calling `Map3DInitConfig.create(...)` directly instead of `.create().copy(...)`
- Configure full-bleed Sticky Immersive Mode (`BEHAVIOR_SHOW_TRANSIENT_BARS_BY_SWIPE`) in `MainActivity.kt` and `Map3DComposeActivity.kt` with opt-out explanation in `codelab.md`
- Add `POLYLINE_CAMERA` and fix `PEARL_HARBOR` coordinates in `HonoluluData.kt`
- Capture and frame all 10 visual codelab screenshots (`codelab/images/*.png`) in System UI Demo Mode
- Replace corrupted JPEG `hibiscus.png` in `starter` with valid PNG, remove unused `controls_background.xml`, deduplicate `strings.xml`, and add `extrudePolygon` unit tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

1 participant