Skip to content

Commit 1332bdb

Browse files
committed
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.
1 parent 748a128 commit 1332bdb

96 files changed

Lines changed: 2077 additions & 742 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<!--
3+
Copyright 2026 Google LLC
4+
5+
Licensed under the Apache License, Version 2.0 (the "License");
6+
you may not use this file except in compliance with the License.
7+
You may obtain a copy of the License at
8+
9+
http://www.apache.org/licenses/LICENSE-2.0
10+
11+
Unless required by applicable law or agreed to in writing, software
12+
distributed under the License is distributed on an "AS IS" BASIS,
13+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
See the License for the specific language governing permissions and
15+
limitations under the License.
16+
-->
17+
<shape xmlns:android="http://schemas.android.com/apk/res/android"
18+
android:shape="oval">
19+
<solid android:color="@android:color/white" />
20+
<stroke
21+
android:width="2dp"
22+
android:color="#3DDC84" />
23+
<size
24+
android:width="44dp"
25+
android:height="44dp" />
26+
</shape>
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<!--
2+
Copyright 2026 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="24"
20+
android:viewportHeight="24"
21+
android:tint="?attr/colorControlNormal">
22+
<path
23+
android:fillColor="@android:color/white"
24+
android:pathData="M12,12m-3.2,0a3.2,3.2 0,1 1,6.4 0a3.2,3.2 0,1 1,-6.4 0"/>
25+
<path
26+
android:fillColor="@android:color/white"
27+
android:pathData="M9,2L7.17,4H4c-1.1,0 -2,0.9 -2,2v12c0,1.1 0.9,2 2,2h16c1.1,0 2,-0.9 2,-2V6c0,-1.1 -0.9,-2 -2,-2h-3.17L15,2H9zm3,15c-2.76,0 -5,-2.24 -5,-5s2.24,-5 5,-5 5,2.24 5,5 -2.24,5 -5,5z"/>
28+
</vector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Copyright 2026 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="24"
20+
android:viewportHeight="24"
21+
android:tint="?attr/colorControlNormal">
22+
<path
23+
android:fillColor="@android:color/white"
24+
android:pathData="M19,6.41L17.59,5 12,10.59 6.41,5 5,6.41 10.59,12 5,17.59 6.41,19 12,13.41 17.59,19 19,17.59 13.41,12z"/>
25+
</vector>
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<!--
2+
Copyright 2026 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="24"
20+
android:viewportHeight="24"
21+
android:tint="?attr/colorControlNormal">
22+
<path
23+
android:fillColor="@android:color/white"
24+
android:pathData="M12,8c-2.21,0 -4,1.79 -4,4s1.79,4 4,4 4,-1.79 4,-4 -1.79,-4 -4,-4zM20.94,11A8.994,8.994 0,0 0,13 3.06V1h-2v2.06A8.994,8.994 0,0 0,3.06 11H1v2h2.06A8.994,8.994 0,0 0,11 20.94V23h2v-2.06A8.994,8.994 0,0 0,20.94 13H23v-2h-2.06zM12,19c-3.87,0 -7,-3.13 -7,-7s3.13,-7 7,-7 7,3.13 7,7 -3.13,7 -7,7z"/>
25+
</vector>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Copyright 2026 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="24"
20+
android:viewportHeight="24">
21+
<path
22+
android:fillColor="@android:color/white"
23+
android:pathData="M3,3v8h8V3H3zm6,6H5V5h4v4zm-6,4v8h8v-8H3zm6,6H5v-4h4v4zm4,-16v8h8V3h-8zm6,6h-4V5h4v4zm-6,4v8h8v-8h-8zm6,6h-4v-4h4v4z" />
24+
</vector>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!--
2+
Copyright 2026 Google LLC
3+
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
7+
8+
http://www.apache.org/licenses/LICENSE-2.0
9+
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
15+
-->
16+
<vector xmlns:android="http://schemas.android.com/apk/res/android"
17+
android:width="24dp"
18+
android:height="24dp"
19+
android:viewportWidth="24"
20+
android:viewportHeight="24">
21+
<path
22+
android:fillColor="@android:color/white"
23+
android:pathData="M3,14h4v-4H3v4zm0,5h4v-4H3v4zM3,9h4V5H3v4zm5,5h13v-4H8v4zm0,5h13v-4H8v4zM8,5v4h13V5H8z" />
24+
</vector>
Lines changed: 141 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<!--
3-
Copyright 2020 Google LLC
3+
Copyright 2025 Google LLC
44
55
Licensed under the Apache License, Version 2.0 (the "License");
66
you may not use this file except in compliance with the License.
@@ -15,52 +15,165 @@
1515
limitations under the License.
1616
-->
1717

18-
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
18+
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
19+
xmlns:app="http://schemas.android.com/apk/res-auto"
1920
android:id="@+id/map_container"
2021
android:layout_width="match_parent"
21-
android:layout_height="match_parent"
22-
android:orientation="vertical">
22+
android:layout_height="match_parent">
23+
24+
<com.google.android.material.appbar.MaterialToolbar
25+
android:id="@+id/topAppBar"
26+
style="@style/Widget.MaterialComponents.Toolbar.Primary"
27+
android:layout_width="match_parent"
28+
android:layout_height="?attr/actionBarSize"
29+
app:layout_constraintEnd_toEndOf="parent"
30+
app:layout_constraintStart_toStartOf="parent"
31+
app:layout_constraintTop_toTopOf="parent"
32+
app:title="@string/snapshot_demo_label" />
2333

2434
<LinearLayout
35+
android:id="@+id/cards_container"
2536
android:layout_width="match_parent"
2637
android:layout_height="0dp"
27-
android:layout_weight="1"
28-
android:orientation="horizontal">
38+
android:layout_marginHorizontal="16dp"
39+
android:layout_marginTop="8dp"
40+
android:layout_marginBottom="4dp"
41+
android:orientation="horizontal"
42+
app:layout_constraintTop_toBottomOf="@id/topAppBar"
43+
app:layout_constraintBottom_toTopOf="@id/bottom_controls"
44+
app:layout_constraintStart_toStartOf="parent"
45+
app:layout_constraintEnd_toEndOf="parent">
2946

30-
<androidx.fragment.app.FragmentContainerView
31-
android:id="@+id/map"
47+
<!-- Left Card: Live Map -->
48+
<com.google.android.material.card.MaterialCardView
49+
android:id="@+id/map_card"
3250
android:layout_width="0dp"
33-
android:layout_weight="1"
3451
android:layout_height="match_parent"
35-
class="com.google.android.gms.maps.SupportMapFragment" />
52+
android:layout_weight="1"
53+
android:layout_marginEnd="6dp"
54+
app:cardCornerRadius="16dp"
55+
app:cardElevation="2dp"
56+
app:strokeWidth="1dp"
57+
app:strokeColor="?attr/colorOutlineVariant">
58+
59+
<FrameLayout
60+
android:layout_width="match_parent"
61+
android:layout_height="match_parent">
62+
63+
<androidx.fragment.app.FragmentContainerView
64+
android:id="@+id/map"
65+
android:name="com.google.android.gms.maps.SupportMapFragment"
66+
android:layout_width="match_parent"
67+
android:layout_height="match_parent" />
3668

37-
<ImageView
38-
android:id="@+id/snapshot_holder"
69+
<com.google.android.material.chip.Chip
70+
android:layout_width="wrap_content"
71+
android:layout_height="wrap_content"
72+
android:layout_gravity="top|start"
73+
android:layout_margin="12dp"
74+
android:clickable="false"
75+
android:text="@string/snapshot_live_map_label"
76+
android:textAppearance="?attr/textAppearanceLabelMedium"
77+
app:chipMinHeight="28dp"
78+
app:chipCornerRadius="8dp" />
79+
</FrameLayout>
80+
</com.google.android.material.card.MaterialCardView>
81+
82+
<!-- Right Card: Snapshot Preview -->
83+
<com.google.android.material.card.MaterialCardView
84+
android:id="@+id/snapshot_card"
3985
android:layout_width="0dp"
40-
android:layout_weight="1"
4186
android:layout_height="match_parent"
42-
android:contentDescription="@string/snapshot_holder_description" />
87+
android:layout_weight="1"
88+
android:layout_marginStart="6dp"
89+
app:cardCornerRadius="16dp"
90+
app:cardElevation="2dp"
91+
app:strokeWidth="1dp"
92+
app:strokeColor="?attr/colorOutlineVariant">
93+
94+
<FrameLayout
95+
android:layout_width="match_parent"
96+
android:layout_height="match_parent">
97+
98+
<!-- Empty State Placeholder -->
99+
<TextView
100+
android:id="@+id/snapshot_placeholder"
101+
android:layout_width="match_parent"
102+
android:layout_height="match_parent"
103+
android:gravity="center"
104+
android:padding="16dp"
105+
android:text="@string/snapshot_placeholder_text"
106+
android:textAlignment="center"
107+
android:textAppearance="?attr/textAppearanceBodyMedium"
108+
android:textColor="?attr/colorOutline"
109+
android:drawablePadding="6dp"
110+
app:drawableTopCompat="@drawable/ic_camera"
111+
app:drawableTint="?attr/colorOutline" />
112+
113+
<ImageView
114+
android:id="@+id/snapshot_holder"
115+
android:layout_width="match_parent"
116+
android:layout_height="match_parent"
117+
android:scaleType="fitCenter"
118+
android:contentDescription="@string/snapshot_holder_description" />
119+
120+
<com.google.android.material.chip.Chip
121+
android:id="@+id/snapshot_label"
122+
android:layout_width="wrap_content"
123+
android:layout_height="wrap_content"
124+
android:layout_gravity="top|start"
125+
android:layout_margin="12dp"
126+
android:clickable="false"
127+
android:visibility="gone"
128+
android:text="@string/snapshot_preview_label"
129+
android:textAppearance="?attr/textAppearanceLabelMedium"
130+
app:chipMinHeight="28dp"
131+
app:chipCornerRadius="8dp" />
132+
</FrameLayout>
133+
</com.google.android.material.card.MaterialCardView>
43134
</LinearLayout>
44135

45-
<CheckBox
46-
android:id="@+id/wait_for_map_load"
136+
<LinearLayout
137+
android:id="@+id/bottom_controls"
47138
android:layout_width="match_parent"
48139
android:layout_height="wrap_content"
49-
android:checked="true"
50-
android:text="@string/wait_for_map_load" />
140+
android:layout_marginHorizontal="16dp"
141+
android:layout_marginBottom="8dp"
142+
android:orientation="horizontal"
143+
android:gravity="center_vertical"
144+
app:layout_constraintBottom_toBottomOf="parent"
145+
app:layout_constraintStart_toStartOf="parent"
146+
app:layout_constraintEnd_toEndOf="parent">
51147

52-
<LinearLayout
53-
android:layout_width="wrap_content"
54-
android:layout_height="wrap_content"
55-
android:orientation="horizontal">
148+
<com.google.android.material.checkbox.MaterialCheckBox
149+
android:id="@+id/wait_for_map_load"
150+
android:layout_width="0dp"
151+
android:layout_height="wrap_content"
152+
android:layout_weight="1"
153+
android:checked="true"
154+
android:text="@string/wait_for_map_load" />
56155

57-
<Button
156+
<LinearLayout
157+
android:id="@+id/bottomContainer"
58158
android:layout_width="wrap_content"
59159
android:layout_height="wrap_content"
60-
android:text="@string/snapshot_take_button" />
160+
android:orientation="horizontal">
61161

62-
<Button
63-
android:layout_height="wrap_content"
64-
android:text="@string/snapshot_clear_button"/>
162+
<com.google.android.material.button.MaterialButton
163+
android:id="@+id/screenshot_button"
164+
android:layout_width="wrap_content"
165+
android:layout_height="wrap_content"
166+
android:layout_marginEnd="8dp"
167+
app:icon="@drawable/ic_camera"
168+
android:text="@string/snapshot_take_button" />
169+
170+
<com.google.android.material.button.MaterialButton
171+
android:id="@+id/clear_button"
172+
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
173+
android:layout_width="wrap_content"
174+
android:layout_height="wrap_content"
175+
app:icon="@drawable/ic_clear"
176+
android:text="@string/snapshot_clear_button" />
177+
</LinearLayout>
65178
</LinearLayout>
66-
</LinearLayout>
179+
</androidx.constraintlayout.widget.ConstraintLayout>

0 commit comments

Comments
 (0)