Skip to content

fix: toggle map color scheme from system state#933

Open
himu-gupta wants to merge 1 commit into
googlemaps:mainfrom
himu-gupta:fix/api-37-dark-mode-toggle
Open

fix: toggle map color scheme from system state#933
himu-gupta wants to merge 1 commit into
googlemaps:mainfrom
himu-gupta:fix/api-37-dark-mode-toggle

Conversation

@himu-gupta

@himu-gupta himu-gupta commented Jun 14, 2026

Copy link
Copy Markdown

Summary

  • Make the first sample dark-mode toggle switch away from the effective system scheme.
  • Preserve explicit LIGHT and DARK toggling behavior.
  • Add unit coverage for light, dark, and FOLLOW_SYSTEM transitions.

Root cause

The sample initializes the map with FOLLOW_SYSTEM, but its first button press always selected DARK. On an API 37 emulator already using dark theme, that is visually DARK to DARK, so the map appears not to react even though Compose state updates. The library runtime mapColorScheme propagation is unchanged.

Verification

  • git diff --check
  • Focused unit tests added in BasicMapActivityTest
  • Local Gradle test/build: blocked by the Codex host sandbox denying the Gradle file-lock socket
  • API 37 before/after screenshots: blocked because no Maps API key is available in the environment

CI is expected to run the repository build, unit tests, screenshot tests, lint, and instrumentation suite.

Fixes #917

@google-cla

google-cla Bot commented Jun 14, 2026

Copy link
Copy Markdown

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@himu-gupta himu-gupta marked this pull request as ready for review June 14, 2026 19:49
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.

Dark mode toggle fails to apply on Android 17 (API 37)

2 participants