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
4 changes: 2 additions & 2 deletions .github/workflows/demo-smoke-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

# Opens every demo in maps-app on an emulator, directly and through the menu, and checks that it
# starts, its map loads, and it survives a zoom and a configuration change. The tests live in
# maps-app/src/androidTest/.../compose/smoke and are excluded from the instrumentation workflow.
# maps-app/src/androidTest/.../compose/demo/smoke and are excluded from the instrumentation workflow.
name: Demo smoke test

on:
Expand Down Expand Up @@ -86,7 +86,7 @@ jobs:
disable-animations: true
script: >-
./gradlew :maps-app:connectedDebugAndroidTest --stacktrace
-Pandroid.testInstrumentationRunnerArguments.package=com.google.maps.android.compose.smoke
-Pandroid.testInstrumentationRunnerArguments.package=com.google.maps.android.compose.demo.smoke
-Pandroid.testInstrumentationRunnerArguments.requireMapLoaded=true

- name: Upload test reports
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/instrumentation-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ jobs:
arch: x86_64
disable-animations: true
# The demo smoke tests run in their own workflow, see demo-smoke-test.yml.
script: ./gradlew createDebugCoverageReport :maps-app:createLibraryCoverageReports --stacktrace -Pandroid.testInstrumentationRunnerArguments.notPackage=com.google.maps.android.compose.smoke
script: ./gradlew createDebugCoverageReport :maps-app:createLibraryCoverageReports --stacktrace -Pandroid.testInstrumentationRunnerArguments.notPackage=com.google.maps.android.compose.demo.smoke

# Stage the coverage reports flat, named after their module, and publish
# them so the post-merge "Record coverage history" workflow can read them
Expand Down
4 changes: 2 additions & 2 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Note that the library modules currently have almost no unit tests. The bulk of
the suite is instrumentation tests under `maps-app/src/androidTest`, so the
`unit` numbers are near zero by nature rather than by regression.

The demo smoke tests in `maps-app/src/androidTest/.../compose/smoke` run in
The demo smoke tests in `maps-app/src/androidTest/.../compose/demo/smoke` run in
their own `Demo smoke test` workflow on API 36, and are excluded from the
instrumentation workflow above, so they do not count towards instrumentation
coverage. `DemoAppSmokeTest` launches every demo directly, `DemoMenuNavigationTest`
Expand All @@ -70,7 +70,7 @@ and they are covered automatically. To run them with a device or emulator attach

```bash
./gradlew :maps-app:connectedDebugAndroidTest \
-Pandroid.testInstrumentationRunnerArguments.package=com.google.maps.android.compose.smoke
-Pandroid.testInstrumentationRunnerArguments.package=com.google.maps.android.compose.demo.smoke
```

Add `-Pandroid.testInstrumentationRunnerArguments.requireMapLoaded=true` to also
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ This library provides optional utilities in the `maps-compose-utils` library fro
The marker clustering utility helps you manage multiple markers at different zoom levels.
When a user views the map at a high zoom level, the individual markers show on the map. When the user zooms out, the markers gather together into clusters, to make viewing the map easier.

The [MarkerClusteringActivity](maps-app/src/main/java/com/google/maps/android/compose/markerexamples/MarkerClusteringActivity.kt) demonstrates usage.
The [MarkerClusteringActivity](maps-app/src/main/java/com/google/maps/android/compose/demo/markerexamples/MarkerClusteringActivity.kt) demonstrates usage.

```kotlin
Clustering(
Expand All @@ -448,7 +448,7 @@ The `fetchStreetViewData` method provides functionality to check whether a locat
> Be sure to [enable Street View Static API](https://goo.gle/enable-sv-static-api) on the project associated with your API key.

You can see example usage
in the [`StreetViewActivity`](https://github.com/googlemaps/android-maps-compose/blob/main/maps-app/src/main/java/com/google/maps/android/compose/StreetViewActivity.kt) of the demo app:
in the [`StreetViewActivity`](https://github.com/googlemaps/android-maps-compose/blob/main/maps-app/src/main/java/com/google/maps/android/compose/demo/StreetViewActivity.kt) of the demo app:

```kotlin
streetViewResult =
Expand All @@ -463,7 +463,7 @@ This library also provides optional composable widgets in the `maps-compose-widg

This widget shows the current scale of the map in feet and meters when zoomed into the map, changing to miles and kilometers, respectively, when zooming out. A `DisappearingScaleBar` is also included, which appears when the zoom level of the map changes, and then disappears after a configurable timeout period.

The [ScaleBarActivity](maps-app/src/main/java/com/google/maps/android/compose/ScaleBarActivity.kt) demonstrates both of these, with the `DisappearingScaleBar` in the upper left corner and the normal base `ScaleBar` in the upper right:
The [ScaleBarActivity](maps-app/src/main/java/com/google/maps/android/compose/demo/ScaleBarActivity.kt) demonstrates both of these, with the `DisappearingScaleBar` in the upper left corner and the normal base `ScaleBar` in the upper right:

![maps-compose-scale-bar-cropped](https://user-images.githubusercontent.com/928045/175665891-a0635004-2201-4392-83b3-0c6553b96926.gif)

Expand Down
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@ tasks.register<Exec>("installAndLaunch") {
description = "Installs and launches the demo app."
group = "install"
dependsOn(":maps-app:installDebug")
commandLine("adb", "shell", "am", "start", "-n", "com.google.maps.android.compose/.MainActivity")
commandLine("adb", "shell", "am", "start", "-n", "com.google.maps.android.compose/.demo.MainActivity")
}
2 changes: 1 addition & 1 deletion docs/lite-mode-dark-theme.md
Original file line number Diff line number Diff line change
Expand Up @@ -163,4 +163,4 @@ fun ThemedLiteMapScreen() {
## Sample Code

A complete, runnable demonstration of this pattern is available in the sample application:
* [LiteModeActivity.kt](../maps-app/src/main/java/com/google/maps/android/compose/LiteModeActivity.kt)
* [LiteModeActivity.kt](../maps-app/src/main/java/com/google/maps/android/compose/demo/LiteModeActivity.kt)
3 changes: 0 additions & 3 deletions gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,4 @@ signing.password=
signing.secretKeyRingFile=

android.experimental.enableScreenshotTest=true
# maps-app shares the com.google.maps.android.compose namespace with maps-compose. Remove this
# once the demo app has its own namespace.
android.uniquePackageNames=false

4 changes: 3 additions & 1 deletion maps-app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,14 @@ android {
}
}

namespace = "com.google.maps.android.compose"
namespace = "com.google.maps.android.compose.demo"
compileSdk = libs.versions.androidCompileSdk.get().toInt()

useLibrary("org.apache.http.legacy")

defaultConfig {
// Kept from before the demo moved to its own namespace, so installs and CI keep working.
applicationId = "com.google.maps.android.compose"
minSdk = libs.versions.androidMinSdk.get().toInt()
targetSdk = libs.versions.androidTargetSdk.get().toInt()
versionCode = 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.foundation.focusable
import androidx.compose.foundation.layout.Box
Expand All @@ -34,6 +34,7 @@ import androidx.compose.ui.test.pressKey
import androidx.compose.ui.test.requestFocus
import androidx.compose.ui.unit.dp
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.GoogleMap
import org.junit.Rule
import org.junit.Test

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -35,9 +35,12 @@ import com.google.android.gms.maps.model.MarkerOptions
import com.google.common.truth.Truth.assertThat
import com.google.maps.android.clustering.ClusterItem
import com.google.maps.android.clustering.ClusterManager
import com.google.maps.android.compose.CameraPositionState
import com.google.maps.android.compose.MapsComposeExperimentalApi
import com.google.maps.android.compose.clustering.Clustering
import com.google.maps.android.compose.clustering.ClusteringMarkerProperties
import com.google.maps.android.compose.markerexamples.MyItem
import com.google.maps.android.compose.demo.markerexamples.MyItem
import com.google.maps.android.compose.rememberComposeBitmapDescriptor
import org.junit.Before
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import android.content.Context
import androidx.compose.foundation.layout.Box
Expand All @@ -37,7 +37,19 @@ import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.android.gms.maps.model.MapColorScheme
import com.google.common.truth.Truth.assertThat
import com.google.maps.android.compose.LatLngSubject.Companion.assertThat
import com.google.maps.android.compose.AdvancedMarkerInfoWindow
import com.google.maps.android.compose.AdvancedMarkerInfoWindowContent
import com.google.maps.android.compose.CameraMoveStartedReason
import com.google.maps.android.compose.CameraPositionState
import com.google.maps.android.compose.ComposeMapColorScheme
import com.google.maps.android.compose.GoogleMap
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.MarkerComposable
import com.google.maps.android.compose.MarkerInfoWindowComposable
import com.google.maps.android.compose.MarkerInfoWindowContent
import com.google.maps.android.compose.MarkerState
import com.google.maps.android.compose.demo.LatLngSubject.Companion.assertThat
import com.google.maps.android.compose.rememberUpdatedMarkerState
import kotlinx.coroutines.runBlocking
import org.junit.Before
import org.junit.Rule
Expand Down
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.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import com.google.android.gms.maps.model.LatLng
import com.google.common.truth.FailureMetadata
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import android.util.Log
import androidx.compose.foundation.layout.fillMaxSize
Expand All @@ -32,6 +32,7 @@ import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.test.swipeUp
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.CameraPositionState
import org.junit.Assert.assertFalse
import org.junit.Assert.assertNotEquals
import org.junit.Assert.assertNotNull
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.foundation.lazy.rememberLazyListState
import androidx.compose.runtime.LaunchedEffect
Expand All @@ -30,6 +30,7 @@ import androidx.compose.ui.test.performTouchInput
import androidx.compose.ui.test.swipeUp
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.CameraPositionState
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Rule
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.ui.Modifier
Expand All @@ -21,6 +21,7 @@ import androidx.compose.ui.test.junit4.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.test.performClick
import com.google.android.gms.maps.model.CameraPosition
import com.google.maps.android.compose.CameraPositionState
import org.junit.Assert.assertNotEquals
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -24,6 +24,7 @@ import androidx.compose.ui.test.assertIsDisplayed
import androidx.compose.ui.test.junit4.v2.createComposeRule
import androidx.compose.ui.test.onNodeWithText
import androidx.compose.ui.unit.dp
import com.google.maps.android.compose.CameraPositionState
import com.google.maps.android.compose.widgets.ScaleBar
import org.junit.Rule
import org.junit.Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import android.graphics.Point
import androidx.compose.foundation.layout.Box
Expand All @@ -23,6 +23,8 @@ import androidx.compose.ui.unit.Density
import androidx.compose.ui.unit.dp
import com.google.android.gms.maps.model.CameraPosition
import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.CameraPositionState
import com.google.maps.android.compose.GoogleMap
import com.google.maps.android.compose.widgets.ScaleBar
import com.google.maps.android.sphericalDistance
import org.junit.Assert.assertTrue
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import androidx.compose.ui.Modifier
import androidx.compose.ui.semantics.contentDescription
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,10 @@
* limitations under the License.
*/

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import com.google.android.gms.maps.model.LatLng
import com.google.maps.android.compose.ComposeMapColorScheme
import org.junit.Assert.assertEquals
import org.junit.Assume.assumeTrue
const val timeout2 = 2_000L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose.smoke
package com.google.maps.android.compose.demo.smoke

import android.graphics.Rect
import android.view.View
Expand All @@ -29,8 +29,8 @@ import com.google.android.gms.maps.MapView
import com.google.android.gms.maps.StreetViewPanoramaView
import com.google.common.truth.Truth.assertThat
import com.google.common.truth.Truth.assertWithMessage
import com.google.maps.android.compose.allActivityGroups
import com.google.maps.android.compose.hasValidApiKey
import com.google.maps.android.compose.demo.allActivityGroups
import com.google.maps.android.compose.demo.hasValidApiKey
import org.junit.After
import org.junit.Assume.assumeTrue
import org.junit.Before
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package com.google.maps.android.compose.smoke
package com.google.maps.android.compose.demo.smoke

import android.app.Activity
import android.os.SystemClock
Expand All @@ -33,13 +33,13 @@ import androidx.test.runner.lifecycle.Stage
import com.google.android.gms.maps.MapView
import com.google.android.gms.maps.StreetViewPanoramaView
import com.google.common.truth.Truth.assertWithMessage
import com.google.maps.android.compose.ActivityGroup
import com.google.maps.android.compose.MainActivity
import com.google.maps.android.compose.StreetViewActivity
import com.google.maps.android.compose.allActivityGroups
import com.google.maps.android.compose.demoTestTag
import com.google.maps.android.compose.groupTestTag
import com.google.maps.android.compose.hasValidApiKey
import com.google.maps.android.compose.demo.ActivityGroup
import com.google.maps.android.compose.demo.MainActivity
import com.google.maps.android.compose.demo.StreetViewActivity
import com.google.maps.android.compose.demo.allActivityGroups
import com.google.maps.android.compose.demo.demoTestTag
import com.google.maps.android.compose.demo.groupTestTag
import com.google.maps.android.compose.demo.hasValidApiKey
import org.junit.After
import org.junit.Before
import org.junit.Rule
Expand All @@ -49,7 +49,7 @@ import org.junit.runners.Parameterized
import java.util.concurrent.CopyOnWriteArrayList
import java.util.concurrent.CountDownLatch
import java.util.concurrent.TimeUnit
import com.google.maps.android.compose.Activity as Demo
import com.google.maps.android.compose.demo.Activity as Demo

/**
* Walks the sample app the way a user does: starts [MainActivity], expands the demo's group,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
* limitations under the License.
*/

package com.google.maps.android.compose.smoke
package com.google.maps.android.compose.demo.smoke

import android.content.ComponentName
import android.content.pm.PackageManager
import androidx.test.platform.app.InstrumentationRegistry
import com.google.common.truth.Truth.assertThat
import com.google.maps.android.compose.MainActivity
import com.google.maps.android.compose.allActivityGroups
import com.google.maps.android.compose.demo.MainActivity
import com.google.maps.android.compose.demo.allActivityGroups
import org.junit.Test

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.maps.android.compose
package com.google.maps.android.compose.demo

import android.os.Bundle
import android.util.Log
Expand All @@ -27,6 +27,13 @@ import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import com.google.android.gms.maps.model.Marker
import com.google.maps.android.compose.GoogleMap
import com.google.maps.android.compose.MapProperties
import com.google.maps.android.compose.MapType
import com.google.maps.android.compose.MapUiSettings
import com.google.maps.android.compose.Marker
import com.google.maps.android.compose.rememberCameraPositionState
import com.google.maps.android.compose.rememberUpdatedMarkerState

private const val TAG = "AccessibilityActivity"

Expand Down
Loading
Loading