Repository navigation
fix(snippets): clean up region tags, remove dummy getter blocks, and fix Kotlin/Java parity - #2451
Conversation
| return null; | ||
| }); | ||
| } | ||
| // [END maps_android_dds_boulder_trails] |
There was a problem hiding this comment.
With the END moved here, maps_android_dds_boulder_trails now covers two methods: it starts in the middle of styleBoulderTrails(), includes its closing brace and the signature of applyBoulderStyling, and ends before that method's closing brace. On DevSite the braces will look unbalanced. Could we either keep the styling inline like the Kotlin version (or a local lambda, like the Kyoto snippet does), or give applyBoulderStyling its own region tag?
| ) | ||
| public void styleLocalityBoundary() { | ||
| // [START maps_android_dds_locality_boundary_java] | ||
| // [START maps_android_dds_locality_boundary] |
There was a problem hiding this comment.
Just to double check: these _java tags only landed in #2426 on Oct 8, so I guess no DevSite page is pointing to them yet and renaming is safe, or do I miss anything?
| if filepath in region_tags: | ||
| for region in region_tags[filepath]: | ||
| if region['start'] <= (i + 15) and region['end'] >= i: | ||
| if region['start'] <= (i + 25) and region['end'] >= i: |
There was a problem hiding this comment.
nit: the window going from 15 to 25 lines will probably break again with the next long description. Just a random idea: could we take the first [START ...] after the @SnippetItem line instead of a fixed window?
kikoso
left a comment
There was a problem hiding this comment.
LGTM! Nice cleanup, the snippets read much better without the getter blocks. Just a few minor comments, nothing blocking.
…fix Kotlin/Java parity
9767989 to
60765e4
Compare
Summary
Cleans up DevSite region tags and snippet bodies across
:snippets:kotlin-appand:snippets:java-appfollowing the PR #2427 migration:MapInitSnippets(maps_android_map_type&maps_android_map_fragment):maps_android_map_typeinMapInitSnippets.ktso it wrapsmap.mapType = GoogleMap.MAP_TYPE_HYBRIDinstead ofmap.setIndoorEnabled(true), and removes the extraneous indoor map enable/getter calls from both Kotlin and Java (maps_android_indoor_*snippets already exist inIndoorSnippetsandEventsSnippets).var mapType: Inton KotlinTrackedMap.if (context is FragmentActivity)harness check inMapInitSnippets.kt(maps_android_map_fragment) in// [START_EXCLUDE silent]to matchMapInitSnippets.java, and importsMapColorSchemein both files.MarkerSnippets,OverlaySnippets,ShapesSnippets):.let { ... }/if (... != null) { ... }blocks that assigned unused local variables for every getter onMarker,GroundOverlay,TileOverlay,Polyline,Polygon, andCircle(which were un-excluded in Kotlin and leaking into DevSite snippets).DatasetLayerSnippets&DataDrivenBoundarySnippetsRegion Tag Parity:Buttonfilter UI inDatasetLayerSnippets.javainside// [START_EXCLUDE silent]and extendsmaps_android_dds_boulder_trailsto includeapplyBoulderStyling(FeatureLayer layer)._javasuffix from region tags inDatasetLayerSnippets.javaandDataDrivenBoundarySnippets.javaso they matchDatasetLayerSnippets.ktandDataDrivenBoundarySnippets.kt.UtilsSnippets&OverlaySnippetsCleanup:map.moveCamera(...)calls outsidemaps_android_markers_draggable,maps_android_utils_heatmap_simple, andmaps_android_utils_heatmap_customize, and replaces fully-qualifiedcom.google.android.gms.maps.*references with imports.@SnippetItem(title = "7b. Remove KML Layer", ...)toUtilsSnippets.kt, addsclusterManager.cluster()tomaps_android_utils_clustering_info_windowinUtilsSnippets.java, and usesprovider.setWeightedData(data)inUtilsSnippets.java.OverlaySnippets.kt.catalog_api.py,CATALOG.md,COVERAGE.md):is*boolean getters the same asget*/set*when checking for missing non-getter/setter APIs.built_in_kotlincoutput directory and skips Kotlin-onlyGoogleMapKtextensions in the Java coverage section.@SnippetItemto[START ...]line window so1. Dataset - Boulder Trailsmaps tomaps_android_dds_boulder_trails.Test Plan
./gradlew :snippets:kotlin-app:assembleDebug :snippets:java-app:assembleDebugpython3 snippets/scripts/catalog_api.py(0missing APIs in Kotlin and0in Java)