Skip to content
Open
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
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2025 Google LLC
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.
Expand Down Expand Up @@ -40,7 +40,7 @@
android:id="@+id/container"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="?attr/colorSurface"
android:padding="5dp"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?><!--
Copyright 2025 Google LLC
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.
Expand Down Expand Up @@ -42,7 +42,7 @@
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:background="?attr/colorSurface"
android:orientation="vertical"
app:layout_constraintTop_toBottomOf="@id/topAppBar">

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Google LLC
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.
Expand Down Expand Up @@ -34,7 +34,7 @@
android:layout_alignParentLeft="true"
android:layout_alignTop="@+id/streetviewpanorama"
android:padding="6dp"
android:background="@color/white"
android:background="?attr/colorSurface"
android:orientation="vertical">

<CheckBox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Google LLC
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.
Expand Down Expand Up @@ -30,7 +30,7 @@
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentRight="true"
android:background="@color/white"
android:background="?attr/colorSurface"
android:orientation="vertical">

<CheckBox
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
Copyright 2025 Google LLC
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.
Expand Down Expand Up @@ -37,7 +37,7 @@
android:layout_height="wrap_content"
android:paddingRight="5dp"
android:paddingEnd="5dp"
android:background="@color/white"
android:background="?attr/colorSurface"
android:orientation="vertical">

<CheckBox
Expand Down
22 changes: 22 additions & 0 deletions ApiDemos/project/common-ui/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?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.
-->
<resources>
<array name="initial_zoom_range">
<item>2.0</item>
<item>21.0</item>
</array>
</resources>
34 changes: 28 additions & 6 deletions ApiDemos/project/common-ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
<resources>
<resources xmlns:tools="http://schemas.android.com/tools">
<string name="demo_title">Maps SDK for Android Demos (Java)</string>
<string name="demo_title_java">Maps SDK for Android Demos (Java)</string>
<string name="demo_title_kotlin">Maps SDK for Android Demos (Kotlin)</string>
Expand All @@ -32,12 +32,18 @@

<string name="camera_clamping_demo_description">Demonstrates how to use Camera Clamping.</string>
<string name="camera_clamping_demo_label">Camera Clamping Demo</string>
<string name="clamp_latlng_adelaide">Clamp to Adelaide</string>
<string name="clamp_latlng_pacific">Clamp to Pacific</string>
<string name="clamp_latlng_reset">Reset LatLng Bounds</string>
<string name="clamp_latlng_adelaide">Adelaide</string>
<string name="clamp_latlng_pacific">Pacific</string>
<string name="clamp_latlng_reset">Reset</string>
<string name="latlng_clamp_status_none">Bounds: None</string>
<string name="latlng_clamp_status_adelaide">Bounds: Adelaide</string>
<string name="latlng_clamp_status_pacific">Bounds: Pacific</string>
<string name="camera_position_format">Position: (%1$.6f, %2$.6f)\nzoom=%3$.1f, tilt=%4$.1f\u00b0, bearing=%5$.1f\u00b0</string>
<string name="clamp_min_zoom">MinZoom++</string>
<string name="clamp_max_zoom">MaxZoom--</string>
<string name="clamp_zoom_reset">Reset Zoom Bounds</string>
<string name="clamp_max_zoom" tools:ignore="TypographyDashes">MaxZoom--</string>
<string name="clamp_zoom_reset">Reset Zoom</string>
<string name="zoom_bounds_label">Zoom Limits: %1$.1f – %2$.1f</string>
<string name="initial_zoom_limits">Zoom Limits: 2.0 – 21.0</string>

<string name="clear_map">Clear</string>
<string name="clickable">Clickable</string>
Expand All @@ -51,6 +57,9 @@
<string name="duration">Custom Duration</string>
<string name="events_demo_label">Events</string>
<string name="events_demo_description">Demonstrates event handling.</string>
<string name="events_tapped_format">Tapped: (%1$s, %2$s)</string>
<string name="events_long_pressed_format">Long pressed: (%1$s, %2$s)</string>
<string name="events_camera_position_format">Position: (%1$s, %2$s)\nzoom=%3$s, tilt=%4$s\u00b0, bearing=%5$s\u00b0</string>
<string name="fade_in">Fade In Tiles</string>
<string name="fill_alpha">Fill Alpha</string>
<string name="fill_hue">Fill Hue</string>
Expand Down Expand Up @@ -121,6 +130,9 @@
<string name="snapshot_demo_description">Demonstrates how to take a snapshot of the map.</string>
<string name="snapshot_holder_description">Area for the map snapshot.</string>
<string name="snapshot_take_button">Take snapshot</string>
<string name="snapshot_live_map_label">Live Map</string>
<string name="snapshot_preview_label">Captured Snapshot</string>
<string name="snapshot_placeholder_text">Tap \"Take snapshot\" to capture the map</string>
<string name="stop_animation">\u25A0</string>
<string name="stroke_alpha">Stroke Alpha</string>
<string name="stroke_hue">Stroke Hue</string>
Expand Down Expand Up @@ -199,10 +211,19 @@
<string name="request_position">Position</string>
<string name="split_street_view_panorama_and_map_demo_description">Demonstrates how to show a Street View panorama and map.</string>
<string name="split_street_view_panorama_and_map_demo_label">Street View Panorama and Map</string>
<string name="split_street_view_instructions">Long-press &amp; drag Pegman on the map to jump Street View. Tap arrows in Street View to walk.</string>
<string name="moved_pegman_to_location">Moved Pegman to your location</string>
<string name="getting_location">Finding your current location\u2026</string>
<string name="waiting_for_location">Location unavailable. Please check device location settings.</string>
<string name="location_permission_required_toast">Location permission is required to find your location. Please grant it in app settings.</string>
<string name="street_view_panorama_basic_demo_description">Standard Street View Panorama using a Fragment.</string>
<string name="street_view_panorama_basic_demo_label">Street View Panorama</string>
<string name="street_view_panorama_events_demo_description">Standard Street View Panorama with event handling.</string>
<string name="street_view_panorama_events_demo_label">Street View Panorama events</string>
<string name="pano_change_times">Times panorama changed=%1$d</string>
<string name="pano_camera_change_times">Times camera changed=%1$d</string>
<string name="pano_click_times">Times clicked=%1$d : %2$s</string>
<string name="pano_long_click_times">Times long clicked=%1$d : %2$s</string>
<string name="street_view_panorama_navigation_demo_description">Street View Panorama with programmatic navigation.</string>
<string name="street_view_panorama_navigation_demo_label">Street View Panorama navigation</string>
<string name="street_view_panorama_options_demo_description">Street View Panorama with toggles for options.</string>
Expand All @@ -217,6 +238,7 @@
<!-- Advanced Markers Demo -->
<string name="advanced_markers_demo_label">Advanced Markers</string>
<string name="advanced_markers_demo_details">Showcases the usage of Advanced Markers.</string>
<string name="advanced_marker_hello">Hello!</string>
<string name="map_id">DEMO_MAP_ID</string>

<!-- Styling -->
Expand Down
3 changes: 2 additions & 1 deletion ApiDemos/project/java-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025 Google LLC
* 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.
Expand Down Expand Up @@ -68,6 +68,7 @@ dependencies {
implementation(libs.recyclerview)
implementation(libs.volley)
implementation(libs.play.services.maps)
implementation(libs.play.services.location)
implementation(libs.material)
implementation(libs.activity)
implementation(project(":ApiDemos:common-ui"))
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// 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.
Expand Down Expand Up @@ -98,13 +98,13 @@ protected void onCreate(final Bundle savedInstanceState) {
@Override
public void onStreetViewPanoramaChange(StreetViewPanoramaLocation location) {
if (location != null) {
panoChangeTimesTextView.setText("Times panorama changed=" + ++panoChangeTimes);
panoChangeTimesTextView.setText(getString(com.example.common_ui.R.string.pano_change_times, ++panoChangeTimes));
}
}

@Override
public void onStreetViewPanoramaCameraChange(StreetViewPanoramaCamera camera) {
panoCameraChangeTextView.setText("Times camera changed=" + ++panoCameraChangeTimes);
panoCameraChangeTextView.setText(getString(com.example.common_ui.R.string.pano_camera_change_times, ++panoCameraChangeTimes));
}

@Override
Expand All @@ -113,7 +113,7 @@ public void onStreetViewPanoramaClick(StreetViewPanoramaOrientation orientation)
if (point != null) {
panoClickTimes++;
panoClickTextView.setText(
"Times clicked=" + panoClickTimes + " : " + point);
getString(com.example.common_ui.R.string.pano_click_times, panoClickTimes, point));
streetViewPanorama.animateTo(
new StreetViewPanoramaCamera.Builder()
.orientation(orientation)
Expand All @@ -128,7 +128,7 @@ public void onStreetViewPanoramaLongClick(StreetViewPanoramaOrientation orientat
if (point != null) {
panoLongClickTimes++;
panoLongClickTextView.setText(
"Times long clicked=" + panoLongClickTimes + " : " + point);
getString(com.example.common_ui.R.string.pano_long_click_times, panoLongClickTimes, point));
}
}
}
4 changes: 3 additions & 1 deletion ApiDemos/project/kotlin-app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

/*
* Copyright 2025 Google LLC
* 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.
Expand Down Expand Up @@ -43,6 +43,7 @@ android {
buildTypes {
getByName("release") {
isMinifyEnabled = true
isShrinkResources = true
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
Expand Down Expand Up @@ -84,6 +85,7 @@ dependencies {
implementation(libs.lifecycle.runtime.ktx)
implementation(libs.maps.ktx)
implementation(libs.maps.utils.ktx)
implementation(libs.play.services.location)

implementation(libs.activity)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// 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.
Expand Down Expand Up @@ -33,7 +33,7 @@ class BackgroundColorCustomizationDemoActivity : SamplesBaseActivity(), OnMapRea
setContentView(R.layout.background_color_customization_demo)
val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment?
mapFragment?.getMapAsync(this)
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2021 Google LLC
// 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.
Expand Down Expand Up @@ -58,7 +58,7 @@ class BackgroundColorCustomizationProgrammaticDemoActivity : SamplesBaseActivity
} else {
mapFragment.getMapAsync(this)
}
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

override fun onMapReady(map: GoogleMap) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* corresponding file under the `app/src/gms` directory.
*/
/*
* Copyright 2020 Google LLC
* 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.
Expand Down Expand Up @@ -50,7 +50,7 @@ class CloudBasedMapStylingDemoActivity : SamplesBaseActivity(), OnMapReadyCallba
val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment?
mapFragment!!.getMapAsync(this)
setUpButtonListeners()
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

override fun onMapReady(map: GoogleMap) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2025 Google LLC
// 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.
Expand Down Expand Up @@ -107,7 +107,7 @@ class DataDrivenBoundariesActivity : SamplesBaseActivity(), OnMapReadyCallback,
setupBoundarySelectorButton() // Setup the new selector button

// --- Insets ---
applyInsets(findViewById<View>(R.id.map_container)) // Apply insets if needed
applyInsets(findViewById(R.id.map_container)) // Apply insets if needed
}

private fun setupBoundarySelectorButton() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025 Google LLC
* 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.
Expand Down Expand Up @@ -46,7 +46,7 @@ class MapColorSchemeActivity :
buttonLight = findViewById(R.id.map_color_light_mode)
buttonDark = findViewById(R.id.map_color_dark_mode)
buttonFollowSystem = findViewById(R.id.map_color_follow_system_mode)
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

override fun onMapReady(googleMap: GoogleMap) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// 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.
Expand Down Expand Up @@ -42,7 +42,7 @@ class MapInPagerDemoActivity : SamplesBaseActivity() {
// This is required to avoid a black flash when the map is loaded. The flash is due
// to the use of a SurfaceView as the underlying view of the map.
pager.requestTransparentRegion(pager)
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

/** A simple fragment that displays a TextView. */
Expand All @@ -55,6 +55,7 @@ class MapInPagerDemoActivity : SamplesBaseActivity() {
}

/** A simple FragmentPagerAdapter that returns two TextFragment and a SupportMapFragment. */
@Suppress("DEPRECATION")
class MyAdapter(fm: FragmentManager) :
FragmentPagerAdapter(fm, BEHAVIOR_RESUME_ONLY_CURRENT_FRAGMENT) {

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2018 Google LLC
* 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.
Expand Down Expand Up @@ -70,7 +70,7 @@ class MarkerCloseInfoWindowOnRetapDemoActivity :

val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment
OnMapAndViewReadyListener(mapFragment, this)
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}

override fun onMapReady(googleMap: GoogleMap?) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2020 Google LLC
// 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.
Expand All @@ -25,6 +25,6 @@ class MultiMapDemoActivity : SamplesBaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.multimap_demo)
applyInsets(findViewById<View>(R.id.map_container))
applyInsets(findViewById(R.id.map_container))
}
}
Loading