Skip to content

feat(maps-compose): default mapColorScheme to FOLLOW_SYSTEM in GoogleMap - #986

Open
dkhawk wants to merge 1 commit into
mainfrom
feat/follow-system-color-scheme
Open

feat(maps-compose): default mapColorScheme to FOLLOW_SYSTEM in GoogleMap#986
dkhawk wants to merge 1 commit into
mainfrom
feat/follow-system-color-scheme

Conversation

@dkhawk

@dkhawk dkhawk commented Aug 31, 2026

Copy link
Copy Markdown
Collaborator

Description

This PR updates GoogleMap's mapColorScheme parameter to default to ComposeMapColorScheme.FOLLOW_SYSTEM instead of null.

Rationale

  • Previously, mapColorScheme defaulted to null. As GoogleMapOptions.getMapColorScheme() returns Java's default 0 (MapColorScheme.LIGHT) and MapUpdater skipped setting map.mapColorScheme when mapColorScheme was null, maps initialized without an explicit mapColorScheme parameter were silently forced into light mode, even when the host device was in system dark theme.
  • Defaulting to ComposeMapColorScheme.FOLLOW_SYSTEM ensures GoogleMap automatically adapts to the system theme out of the box, adhering to standard Jetpack Compose and Material 3 design expectations.

Verification

  • Added regression tests testDefaultColorSchemeIsFollowSystem and testDefaultColorSchemeWithGoogleMapOptionsFactory in GoogleMapViewTests.kt.
  • Verified all 22 tests in GoogleMapViewTests pass on device.

Default `GoogleMap`'s `mapColorScheme` parameter to `ComposeMapColorScheme.FOLLOW_SYSTEM`
instead of `null`.

Previously, `mapColorScheme` defaulted to `null`, which resulted in `GoogleMapOptions`
retaining the unconfigured Java int default of `0` (`MapColorScheme.LIGHT`) and left
`map.mapColorScheme` unset in `MapUpdater`. This forced maps created without an explicit
`mapColorScheme` parameter into light mode on dark-themed devices.

Defaulting to `FOLLOW_SYSTEM` ensures `GoogleMap` automatically adheres to the system theme
out of the box, aligning with Compose and Android conventions.

Includes regression tests in `GoogleMapViewTests.kt` validating that default `GoogleMap`
invocations and factory configurations receive `MapColorScheme.FOLLOW_SYSTEM`.
@dkhawk
dkhawk requested review from LoyalAbbas and kikoso August 31, 2026 21:50
@googlemaps-bot

Copy link
Copy Markdown
Contributor

Code Coverage

Overall Project 25.74%

There is no coverage information present for the Files changed

@LoyalAbbas LoyalAbbas left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants