From 1332bdbc18cbe1ba49bba8cb852dcc79e95a7c74 Mon Sep 17 00:00:00 2001 From: Dale Hawkins <107309+dkhawk@users.noreply.github.com> Date: Tue, 18 Aug 2026 14:39:49 -0600 Subject: [PATCH] feat(samples): modernize UI, edge-to-edge insets, camera framing, and sample reliability - Edge-to-Edge & System Insets: * Updated SamplesBaseActivity (Kotlin & Java) to safely apply window insets to root containers and programmatic layouts without double-insetting nested fragments. * Corrected constraints and margins across all demo layouts. - Split Street View Panorama & Map Demo: * Added Material 3 "My Location" Floating Action Button powered by FusedLocationProviderClient (PRIORITY_HIGH_ACCURACY) with runtime permission handling. * Added dismissible instruction banner explaining bidirectional sync. * Synchronized Pegman marker heading and camera tracking between Map and Panorama. * Updated initial camera framing centered on Sydney Harbour with rich docstrings. - Snapshot Demo Modernization (SnapshotDemoActivity): * Redesigned UI with Material 3 cards for capture controls, options, and preview. * Added custom vector icons (ic_camera, ic_clear) with Apache 2.0 license headers. * Updated initial camera focal point to Venice (45.4371, 12.3345, zoom 16f). * Optimized portrait and landscape layouts (layout/ and layout-land/). - Advanced Markers, Datasets, & Map Overlays: * AdvancedMarkersDemoActivity: Added custom framed badge iconView with Android green border and LatLngBounds camera initialization enclosing all Southeast Asia markers. * GroundOverlayDemoActivity: Configured LatLngBounds viewport framing and 0.2f initial transparency so underlying map details remain visible. * DataDrivenDatasetStylingActivity: Added LatLngBounds with padding to frame dataset features across Kotlin and Java demos. - Lite List Demo Modernization (LiteListDemoActivity): * Redesigned list rows with Material 3 MaterialCardView tiles, rounded corners, elevation, and styled headers with location icon. * Added ic_view_list and ic_view_grid vector drawables. * Wired MaterialToolbar to support switching between Linear List and 2-column Grid modes. - Location Source & Core Demos: * LocationSourceDemoActivity: Fixed toolbar title to display "Location Source Demo". * Verified PolygonDemoActivity, PolylineDemoActivity, and CircleDemoActivity on device. - Wear OS Sample (com.example.wearos): * Added safe exception handling around AmbientModeSupport.attach() in MainActivity and AmbientActivity (Kotlin & Java) to guard against missing wearable shared libraries. * Verified circular map and interactive marker info windows on Wear OS emulator. - Compose (FireMarkers), Snippets, & Tutorials: * FireMarkers: Refactored marker position animations with rememberUpdatedMarkerState. * Snippets: Fixed null safety and field initialization in KML.kt and Multilayer.kt. * Tutorials: Modernized string templates, test runners, and dependencies. * Lint & Resources: Resolved lint warnings, replaced hardcoded strings with resource entries, and specified explicit Locales in String.format. --- .../src/main/res/drawable/bg_marker_badge.xml | 26 ++ .../src/main/res/drawable/ic_camera.xml | 28 ++ .../src/main/res/drawable/ic_clear.xml | 25 ++ .../src/main/res/drawable/ic_my_location.xml | 25 ++ .../src/main/res/drawable/ic_view_grid.xml | 24 ++ .../src/main/res/drawable/ic_view_list.xml | 24 ++ .../main/res/layout-land/snapshot_demo.xml | 169 ++++++++-- .../main/res/layout/camera_clamping_demo.xml | 83 +++-- .../src/main/res/layout/camera_demo.xml | 8 +- .../src/main/res/layout/events_demo.xml | 9 +- .../main/res/layout/ground_overlay_demo.xml | 2 +- .../src/main/res/layout/layers_demo.xml | 16 +- .../src/main/res/layout/lite_list_demo.xml | 11 +- .../main/res/layout/lite_list_demo_row.xml | 52 +-- .../src/main/res/layout/marker_demo.xml | 121 +++---- .../src/main/res/layout/snapshot_demo.xml | 138 ++++++-- ...plit_street_view_panorama_and_map_demo.xml | 35 ++- .../street_view_panorama_events_demo.xml | 2 +- .../street_view_panorama_options_demo.xml | 2 +- .../src/main/res/layout/tile_overlay_demo.xml | 2 +- .../src/main/res/layout/ui_settings_demo.xml | 2 +- .../src/main/res/menu/lite_list_menu.xml | 6 +- .../common-ui/src/main/res/values/arrays.xml | 22 ++ .../common-ui/src/main/res/values/strings.xml | 34 +- ApiDemos/project/java-app/build.gradle.kts | 1 + .../mapdemo/AdvancedMarkersDemoActivity.java | 32 +- .../mapdemo/CameraClampingDemoActivity.java | 80 +++-- .../DataDrivenDatasetStylingActivity.java | 41 ++- .../example/mapdemo/EventsDemoActivity.java | 38 ++- .../mapdemo/GroundOverlayDemoActivity.java | 16 +- .../example/mapdemo/LayersDemoActivity.java | 9 + .../example/mapdemo/LiteListDemoActivity.java | 4 + .../mapdemo/LocationSourceDemoActivity.java | 5 + .../example/mapdemo/MarkerDemoActivity.java | 9 +- .../example/mapdemo/SamplesBaseActivity.java | 65 +++- .../example/mapdemo/SnapshotDemoActivity.java | 35 ++- ...tStreetViewPanoramaAndMapDemoActivity.java | 248 ++++++++++++++- .../StreetViewPanoramaEventsDemoActivity.java | 8 +- .../mapdemo/VisibleRegionDemoActivity.java | 6 +- .../example/mapdemo/MarkerDemoActivity.java | 9 +- .../mapdemo/VisibleRegionDemoActivity.java | 6 +- ApiDemos/project/kotlin-app/build.gradle.kts | 2 + .../AdvancedMarkersDemoActivity.kt | 142 +++++---- ...ackgroundColorCustomizationDemoActivity.kt | 2 +- ...orCustomizationProgrammaticDemoActivity.kt | 2 +- .../kotlindemos/CameraClampingDemoActivity.kt | 75 +++-- .../CloudBasedMapStylingDemoActivity.kt | 2 +- .../DataDrivenBoundariesActivity.kt | 2 +- .../DataDrivenDatasetStylingActivity.kt | 45 ++- .../example/kotlindemos/EventsDemoActivity.kt | 32 +- .../kotlindemos/GroundOverlayDemoActivity.kt | 14 +- .../example/kotlindemos/LayersDemoActivity.kt | 10 + .../kotlindemos/LiteListDemoActivity.kt | 26 +- .../kotlindemos/LocationSourceDemoActivity.kt | 20 +- .../kotlindemos/MapColorSchemeActivity.kt | 2 +- .../kotlindemos/MapInPagerDemoActivity.kt | 3 +- ...arkerCloseInfoWindowOnRetapDemoActivity.kt | 2 +- .../example/kotlindemos/MarkerDemoActivity.kt | 14 +- .../kotlindemos/MultiMapDemoActivity.kt | 2 +- .../kotlindemos/MyLocationDemoActivity.kt | 2 +- .../kotlindemos/OnMapAndViewReadyListener.kt | 28 +- .../kotlindemos/PolygonDemoActivity.kt | 2 +- .../kotlindemos/PolylineDemoActivity.kt | 4 +- .../kotlindemos/ProgrammaticDemoActivity.kt | 8 +- .../kotlindemos/RetainMapDemoActivity.kt | 6 +- .../kotlindemos/SamplesBaseActivity.kt | 86 ++++- .../kotlindemos/SaveStateDemoActivity.kt | 14 +- .../kotlindemos/SnapshotDemoActivity.kt | 54 +++- ...litStreetViewPanoramaAndMapDemoActivity.kt | 222 ++++++++++++- .../StreetViewPanoramaBasicDemoActivity.kt | 2 +- .../StreetViewPanoramaEventsDemoActivity.kt | 10 +- ...treetViewPanoramaNavigationDemoActivity.kt | 2 +- .../StreetViewPanoramaViewDemoActivity.kt | 2 +- .../kotlindemos/StyledMapDemoActivity.kt | 296 +++++++++--------- .../example/kotlindemos/TagsDemoActivity.kt | 2 +- .../kotlindemos/VisibleRegionDemoActivity.kt | 3 +- .../src/main/res/layout/save_state_demo.xml | 51 +++ .../example/kotlindemos/MarkerDemoActivity.kt | 14 +- .../kotlindemos/OnMapAndViewReadyListener.kt | 27 +- .../kotlindemos/VisibleRegionDemoActivity.kt | 3 +- .../com/example/firemarkers/MainActivity.kt | 20 +- WearOS/Wearable/build.gradle.kts | 17 +- .../example/wearosmap/AmbientActivity.java | 10 +- .../com/example/wearosmap/MainActivity.java | 10 +- .../example/wearosmap/kt/AmbientActivity.kt | 10 +- .../com/example/wearosmap/kt/MainActivity.kt | 10 +- gradle/libs.versions.toml | 2 + snippets/app-compose/build.gradle.kts | 1 + snippets/app-ktx/build.gradle.kts | 1 + .../java/com/example/app_utils_ktx/KML.kt | 2 +- .../com/example/app_utils_ktx/Multilayer.kt | 12 +- .../com/google/maps/example/TileOverlays.java | 3 +- tutorials/java/Polygons/app/build.gradle.kts | 2 +- .../app/build.gradle.kts | 2 +- .../kotlin/Polygons/app/build.gradle.kts | 2 +- .../java/com/example/polygons/PolyActivity.kt | 2 +- 96 files changed, 2077 insertions(+), 742 deletions(-) create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/bg_marker_badge.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/ic_camera.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/ic_clear.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/ic_my_location.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/ic_view_grid.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/drawable/ic_view_list.xml create mode 100644 ApiDemos/project/common-ui/src/main/res/values/arrays.xml create mode 100644 ApiDemos/project/kotlin-app/src/main/res/layout/save_state_demo.xml diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/bg_marker_badge.xml b/ApiDemos/project/common-ui/src/main/res/drawable/bg_marker_badge.xml new file mode 100644 index 000000000..3b413cf19 --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/bg_marker_badge.xml @@ -0,0 +1,26 @@ + + + + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/ic_camera.xml b/ApiDemos/project/common-ui/src/main/res/drawable/ic_camera.xml new file mode 100644 index 000000000..a16c5e068 --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/ic_camera.xml @@ -0,0 +1,28 @@ + + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/ic_clear.xml b/ApiDemos/project/common-ui/src/main/res/drawable/ic_clear.xml new file mode 100644 index 000000000..a7280e26d --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/ic_clear.xml @@ -0,0 +1,25 @@ + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/ic_my_location.xml b/ApiDemos/project/common-ui/src/main/res/drawable/ic_my_location.xml new file mode 100644 index 000000000..ec26c8b2b --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/ic_my_location.xml @@ -0,0 +1,25 @@ + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_grid.xml b/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_grid.xml new file mode 100644 index 000000000..b7f6ad231 --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_grid.xml @@ -0,0 +1,24 @@ + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_list.xml b/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_list.xml new file mode 100644 index 000000000..c93fbc29d --- /dev/null +++ b/ApiDemos/project/common-ui/src/main/res/drawable/ic_view_list.xml @@ -0,0 +1,24 @@ + + + + diff --git a/ApiDemos/project/common-ui/src/main/res/layout-land/snapshot_demo.xml b/ApiDemos/project/common-ui/src/main/res/layout-land/snapshot_demo.xml index 3f59eb7ee..291f55522 100755 --- a/ApiDemos/project/common-ui/src/main/res/layout-land/snapshot_demo.xml +++ b/ApiDemos/project/common-ui/src/main/res/layout-land/snapshot_demo.xml @@ -1,6 +1,6 @@ - + android:layout_height="match_parent"> + + + android:layout_marginHorizontal="16dp" + android:layout_marginTop="8dp" + android:layout_marginBottom="4dp" + android:orientation="horizontal" + app:layout_constraintTop_toBottomOf="@id/topAppBar" + app:layout_constraintBottom_toTopOf="@id/bottom_controls" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - + + android:layout_weight="1" + android:layout_marginEnd="6dp" + app:cardCornerRadius="16dp" + app:cardElevation="2dp" + app:strokeWidth="1dp" + app:strokeColor="?attr/colorOutlineVariant"> + + + + - + + + + + + android:layout_weight="1" + android:layout_marginStart="6dp" + app:cardCornerRadius="16dp" + app:cardElevation="2dp" + app:strokeWidth="1dp" + app:strokeColor="?attr/colorOutlineVariant"> + + + + + + + + + + + - + android:layout_marginHorizontal="16dp" + android:layout_marginBottom="8dp" + android:orientation="horizontal" + android:gravity="center_vertical" + app:layout_constraintBottom_toBottomOf="parent" + app:layout_constraintStart_toStartOf="parent" + app:layout_constraintEnd_toEndOf="parent"> - + -