Commit 9505705
authored
feat(samples): implement additional maker customization samples (#29)
* feat(samples): implement monster tour, long-press, and altitude modes
- Replaced hardcoded markers with dynamic parsing from monsters.json
- Implemented automated sequential tour of all markers in Kotlin and Java
- Added a long-press PopupMenu to the Random Monster button for quick selection
- Configured individual AltitudeModes for markers via JSON
* refactor(java): use formal imports instead of fully qualified class names
* feat(sample): refactor monster data parsing and implement robust test suite
- Extracted JSON parsing logic into dedicated `Monster` and `MonsterParser` classes for both Kotlin and Java apps to clean up activity bloat.
- Refactored `MarkersActivity` in both languages to utilize the new abstractions.
- Fixed a timing bug in the Java `MarkersActivity` by ensuring `setMapMode` and marker placements await `setOnMapReadyListener`, aligning its behavior with the Kotlin implementation.
- Added comprehensive unit tests for the parsing logic.
- Added Robolectric integration tests to validate complex asset parsing in an emulated environment.
- Migrated all test assertions to Google Truth (`com.google.truth:truth`) for better readability.
- Added necessary test dependencies (Robolectric, Truth, JSON) to the relevant Version Catalogs.
* fix(samples): synchronize tour with steady map state and add tour cancellation
- Implement double-wait pattern utilizing OnMapSteadyListener to prevent tour animations from skipping past unrendered terrain.
- Added stopMonsterTour calls to all other navigation buttons.
* feat(samples): port missing popovers and map interaction samples to Java
* test(mainactivity): add tests verifying all samples present in launcher list
* feat(samples): disable auto-panning for Giant Ape popover
* style: minor formatting and UI opacity tweaks
* refactor(samples): introduce Coroutine extensions for Maps 3D callbacks
* docs(samples): add educational comments to Java markers sample
* refactor(samples): convert long literals to Duration inWholeMilliseconds
* refactor(samples): introduce CompletableFuture extensions for Java app
* fix(samples): ensure map steady is awaited after camera flight completes in Java
* docs(samples): add extensive inline comments to Java CompletableFuture chain
* Address review comments: remove FQDN and extract text content descriptions1 parent 08868c6 commit 9505705
39 files changed
Lines changed: 1987 additions & 190 deletions
File tree
- Maps3DSamples/ApiDemos
- common
- src/main
- assets
- res
- drawable
- layout
- values
- gradle
- java-app
- src
- main
- java/com/example/maps3djava
- common
- mainactivity
- mapinteractions
- markers
- data
- popovers
- sampleactivity
- test/java/com/example/maps3djava
- mainactivity
- markers/data
- kotlin-app
- src
- main/java/com/example/maps3dkotlin
- common
- markers
- data
- sampleactivity
- test/java/com/example/maps3dkotlin
- mainactivity
- markers/data
- gradle
- snippets/java-app/src/main/java/com/example/snippets/java/snippets
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
| 72 | + | |
| 73 | + | |
74 | 74 | | |
Lines changed: 130 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
0 commit comments