Skip to content

fix: reactively apply dark mode on Android when system theme changes#53

Merged
lodev09 merged 1 commit intomainfrom
fix/android-theme-configuration-change
Mar 23, 2026
Merged

fix: reactively apply dark mode on Android when system theme changes#53
lodev09 merged 1 commit intomainfrom
fix/android-theme-configuration-change

Conversation

@lodev09
Copy link
Copy Markdown
Collaborator

@lodev09 lodev09 commented Mar 23, 2026

Summary

React Native prevents Activity recreation on configuration changes (android:configChanges), so Google Maps' MapColorScheme.FOLLOW_SYSTEM never gets notified when the device toggles dark mode. This registers a ComponentCallbacks2 listener on the application context to detect UI mode changes and re-apply the map color scheme.

Closes #47

Type of Change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Test Plan

  • Set theme="system" on MapView
  • Toggle device dark mode from system settings
  • Map should reactively switch between light and dark styles without remounting

Checklist

  • I tested on iOS
  • I tested on Android
  • I tested on Web
  • I updated the documentation (if needed)

@lodev09 lodev09 merged commit 2e22598 into main Mar 23, 2026
3 checks passed
@lodev09 lodev09 deleted the fix/android-theme-configuration-change branch March 23, 2026 16:55
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.

MapView with theme="system" does not reactively apply dark mode on Android (Google Maps) when the device appearance changes.

1 participant