Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="oval">
<solid android:color="@android:color/white" />
<stroke
android:width="2dp"
android:color="#3DDC84" />
<size
android:width="44dp"
android:height="44dp" />
</shape>
28 changes: 28 additions & 0 deletions ApiDemos/project/common-ui/src/main/res/drawable/ic_camera.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
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"/>
<path
android:fillColor="@android:color/white"
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"/>
</vector>
25 changes: 25 additions & 0 deletions ApiDemos/project/common-ui/src/main/res/drawable/ic_clear.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
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"/>
</vector>
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24"
android:tint="?attr/colorControlNormal">
<path
android:fillColor="@android:color/white"
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"/>
</vector>
24 changes: 24 additions & 0 deletions ApiDemos/project/common-ui/src/main/res/drawable/ic_view_grid.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M3,3v8h8V3H3zm6,6H5V5h4v4zm-6,4v8h8v-8H3zm6,6H5v-4h4v4zm4,-16v8h8V3h-8zm6,6h-4V5h4v4zm-6,4v8h8v-8h-8zm6,6h-4v-4h4v4z" />
</vector>
24 changes: 24 additions & 0 deletions ApiDemos/project/common-ui/src/main/res/drawable/ic_view_list.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<!--
Copyright 2026 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
android:width="24dp"
android:height="24dp"
android:viewportWidth="24"
android:viewportHeight="24">
<path
android:fillColor="@android:color/white"
android:pathData="M3,14h4v-4H3v4zm0,5h4v-4H3v4zM3,9h4V5H3v4zm5,5h13v-4H8v4zm0,5h13v-4H8v4zM8,5v4h13V5H8z" />
</vector>
169 changes: 141 additions & 28 deletions ApiDemos/project/common-ui/src/main/res/layout-land/snapshot_demo.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2020 Google LLC
Copyright 2025 Google LLC

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -15,52 +15,165 @@
limitations under the License.
-->

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/map_container"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="match_parent">

<com.google.android.material.appbar.MaterialToolbar
android:id="@+id/topAppBar"
style="@style/Widget.MaterialComponents.Toolbar.Primary"
android:layout_width="match_parent"
android:layout_height="?attr/actionBarSize"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent"
app:title="@string/snapshot_demo_label" />

<LinearLayout
android:id="@+id/cards_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_weight="1"
android:orientation="horizontal">
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">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/map"
<!-- Left Card: Live Map -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/map_card"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
class="com.google.android.gms.maps.SupportMapFragment" />
android:layout_weight="1"
android:layout_marginEnd="6dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp"
app:strokeWidth="1dp"
app:strokeColor="?attr/colorOutlineVariant">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<androidx.fragment.app.FragmentContainerView
android:id="@+id/map"
android:name="com.google.android.gms.maps.SupportMapFragment"
android:layout_width="match_parent"
android:layout_height="match_parent" />

<ImageView
android:id="@+id/snapshot_holder"
<com.google.android.material.chip.Chip
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|start"
android:layout_margin="12dp"
android:clickable="false"
android:text="@string/snapshot_live_map_label"
android:textAppearance="?attr/textAppearanceLabelMedium"
app:chipMinHeight="28dp"
app:chipCornerRadius="8dp" />
</FrameLayout>
</com.google.android.material.card.MaterialCardView>

<!-- Right Card: Snapshot Preview -->
<com.google.android.material.card.MaterialCardView
android:id="@+id/snapshot_card"
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="match_parent"
android:contentDescription="@string/snapshot_holder_description" />
android:layout_weight="1"
android:layout_marginStart="6dp"
app:cardCornerRadius="16dp"
app:cardElevation="2dp"
app:strokeWidth="1dp"
app:strokeColor="?attr/colorOutlineVariant">

<FrameLayout
android:layout_width="match_parent"
android:layout_height="match_parent">

<!-- Empty State Placeholder -->
<TextView
android:id="@+id/snapshot_placeholder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:padding="16dp"
android:text="@string/snapshot_placeholder_text"
android:textAlignment="center"
android:textAppearance="?attr/textAppearanceBodyMedium"
android:textColor="?attr/colorOutline"
android:drawablePadding="6dp"
app:drawableTopCompat="@drawable/ic_camera"
app:drawableTint="?attr/colorOutline" />

<ImageView
android:id="@+id/snapshot_holder"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scaleType="fitCenter"
android:contentDescription="@string/snapshot_holder_description" />

<com.google.android.material.chip.Chip
android:id="@+id/snapshot_label"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="top|start"
android:layout_margin="12dp"
android:clickable="false"
android:visibility="gone"
android:text="@string/snapshot_preview_label"
android:textAppearance="?attr/textAppearanceLabelMedium"
app:chipMinHeight="28dp"
app:chipCornerRadius="8dp" />
</FrameLayout>
</com.google.android.material.card.MaterialCardView>
</LinearLayout>

<CheckBox
android:id="@+id/wait_for_map_load"
<LinearLayout
android:id="@+id/bottom_controls"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:checked="true"
android:text="@string/wait_for_map_load" />
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">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal">
<com.google.android.material.checkbox.MaterialCheckBox
android:id="@+id/wait_for_map_load"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:checked="true"
android:text="@string/wait_for_map_load" />

<Button
<LinearLayout
android:id="@+id/bottomContainer"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/snapshot_take_button" />
android:orientation="horizontal">

<Button
android:layout_height="wrap_content"
android:text="@string/snapshot_clear_button"/>
<com.google.android.material.button.MaterialButton
android:id="@+id/screenshot_button"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginEnd="8dp"
app:icon="@drawable/ic_camera"
android:text="@string/snapshot_take_button" />

<com.google.android.material.button.MaterialButton
android:id="@+id/clear_button"
style="@style/Widget.MaterialComponents.Button.OutlinedButton"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:icon="@drawable/ic_clear"
android:text="@string/snapshot_clear_button" />
</LinearLayout>
</LinearLayout>
</LinearLayout>
</androidx.constraintlayout.widget.ConstraintLayout>
Loading