diff --git a/ApiDemos/kotlin/app/build.gradle b/ApiDemos/kotlin/app/build.gradle
index 3c30b0af..cbb0a95b 100644
--- a/ApiDemos/kotlin/app/build.gradle
+++ b/ApiDemos/kotlin/app/build.gradle
@@ -67,7 +67,9 @@ dependencies {
implementation 'androidx.multidex:multidex:2.0.1'
// GMS
+ gmsImplementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
gmsImplementation 'com.google.android.gms:play-services-maps:17.0.0'
+ gmsImplementation 'com.google.maps.android:maps-ktx:2.2.0'
// V3
v3Implementation 'com.google.android.libraries.maps:maps:3.1.0-beta'
diff --git a/ApiDemos/kotlin/app/src/gms/AndroidManifest.xml b/ApiDemos/kotlin/app/src/gms/AndroidManifest.xml
index 35caaa84..be24826f 100644
--- a/ApiDemos/kotlin/app/src/gms/AndroidManifest.xml
+++ b/ApiDemos/kotlin/app/src/gms/AndroidManifest.xml
@@ -16,47 +16,49 @@
-
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraClampingDemoActivity.kt b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraClampingDemoActivity.kt
new file mode 100644
index 00000000..a4c3dd16
--- /dev/null
+++ b/ApiDemos/kotlin/app/src/gms/java/com/example/kotlindemos/CameraClampingDemoActivity.kt
@@ -0,0 +1,145 @@
+// Copyright 2020 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.
+package com.example.kotlindemos
+
+import android.os.Bundle
+import android.util.Log
+import android.view.View
+import android.widget.Button
+import android.widget.TextView
+import android.widget.Toast
+import androidx.appcompat.app.AppCompatActivity
+import androidx.lifecycle.lifecycleScope
+import com.google.android.gms.maps.CameraUpdateFactory
+import com.google.android.gms.maps.GoogleMap
+import com.google.android.gms.maps.GoogleMap.OnCameraIdleListener
+import com.google.android.gms.maps.OnMapReadyCallback
+import com.google.android.gms.maps.SupportMapFragment
+import com.google.android.gms.maps.model.CameraPosition
+import com.google.android.gms.maps.model.LatLng
+import com.google.android.gms.maps.model.LatLngBounds
+import com.google.maps.android.ktx.CameraIdleEvent
+import com.google.maps.android.ktx.awaitMap
+import com.google.maps.android.ktx.cameraEvents
+import kotlinx.coroutines.ExperimentalCoroutinesApi
+import kotlinx.coroutines.coroutineScope
+import kotlinx.coroutines.flow.collect
+import kotlinx.coroutines.launch
+
+/**
+ * This shows how to constrain the camera to specific boundaries and zoom levels.
+ */
+class CameraClampingDemoActivity : AppCompatActivity() {
+
+ private lateinit var map: GoogleMap
+ private lateinit var cameraTextView: TextView
+ private val buttonIdToLatLngBoundsCameraMap = mapOf(
+ Pair(R.id.clamp_latlng_adelaide, Pair(ADELAIDE, ADELAIDE_CAMERA)),
+ Pair(R.id.clamp_latlng_pacific, Pair(PACIFIC, PACIFIC_CAMERA)),
+ )
+
+ /**
+ * Internal min zoom level that can be toggled via the demo.
+ */
+ private var minZoom = DEFAULT_MIN_ZOOM
+
+ /**
+ * Internal max zoom level that can be toggled via the demo.
+ */
+ private var maxZoom = DEFAULT_MAX_ZOOM
+
+ @ExperimentalCoroutinesApi
+ override fun onCreate(savedInstanceState: Bundle?) {
+ super.onCreate(savedInstanceState)
+ setContentView(R.layout.camera_clamping_demo)
+ cameraTextView = findViewById(R.id.camera_text)
+ val mapFragment = supportFragmentManager.findFragmentById(R.id.map) as SupportMapFragment
+ lifecycleScope.launchWhenCreated {
+ map = mapFragment.awaitMap()
+ launch {
+ map.cameraEvents().collect { event ->
+ when (event) {
+ is CameraIdleEvent -> onCameraIdle()
+ else -> Log.d(TAG, "Got event: $event")
+ }
+ }
+ }
+ setButtonClickListeners()
+ }
+ }
+
+ private fun setButtonClickListeners() {
+ // Min/max zooms
+ findViewById