applyDarkModeStyle

abstract fun applyDarkModeStyle(isDark: Boolean)

Apply the map's dark/light mode to the map style.

isDark is the mode the Android Auto map must be drawn in: the car's day/night mode, unless the user chose to keep the map in day or night colours (AADayNightMode, held by AAMapState.dayNightMode).

Called when that mode changes — the car switches between day and night (the SDK reads the car's mode when the session and the surface start, and on every Session.onCarConfigurationChanged), or the user changes their choice. The implementation should set the appropriate map style (e.g., "Day" or "Night") on the app's map state the Android Auto MapView is drawn from.

Also called for each MapView the SDK brings up, just before initializeMapView, with the current mode — so the initial state initializeMapView applies includes it — and when the mode changes while a MapView is being brought up. The implementation must therefore not depend on initializeMapView having run. An exception it throws is logged by the SDK and does not stop the MapView's bring-up.

Parameters

isDark

True for night/dark mode, false for day/light mode