Theme Mode
enum class AgentforceThemeMode
Controls whether the SDK renders its light palette, its dark palette, or follows the device’s system setting.
Declared in package com.salesforce.android.agentforcesdk.components.theme.
| Member | Description |
|---|---|
SYSTEM | Follow the device’s light/dark setting. Recomposes automatically when the setting changes. |
LIGHT | Always render the light palette, regardless of the device setting. |
DARK | Always render the dark palette, regardless of the device setting. |
Set themeMode on AgentforceThemeOverrides or pass it to createCustomAgentforceThemeManager(...):
If you don’t set themeMode, createDefaultAgentforceThemeManager() uses LIGHT and createCustomAgentforceThemeManager(...) defaults to SYSTEM.
AgentforceThemeManager.getThemeMode() returns the configured mode as-is, without resolving SYSTEM. To find out which palette is actually rendering — including the resolved value when the mode is SYSTEM — call the composable isDarkMode() instead:
- Theme mode always comes from your app’s configuration, falling back to the SDK default.
- Test your theme in both light and dark mode, and check color contrast in each (WCAG AA).
- AgentforceThemeManager —
getThemeMode()andisDarkMode(). - AgentforceColors — the light and dark palettes that theme mode selects between.