Android Theming Overview
Theming system and visual customization for the Agentforce Android SDK.
The SDK lets you customize colors, typography, icons, on-screen text, and light/dark behavior for every UI component in the full-UI chat experience. All theming types live in the package com.salesforce.android.agentforcesdk.components.theme.
Supply a theme once, through AgentforceConfiguration.Builder.setTheming(...). List only the tokens you want to change; everything else keeps its SDK default.
| Area | Type(s) | Scope |
|---|---|---|
| Colors | AgentforceColorPalette, AgentforceColorToken | 271 tokens — 47 foundation plus 224 component-level across 50 component groups. |
| Font family | AgentforceTypography.copyWithFontFamily(...) | Applies your font to all 23 text styles at once. |
| Per-style typography | Typography.mergeWith(...) | Adjust the weight, size, or line height of individual styles. |
| Icons | AgentforceIconType, AgentforceIcon | 23 replaceable icons, with optional separate light and dark variants. |
| Display-name strings | AgentforceDisplayNameType | 45 user-visible strings such as titles, hints, and button labels. |
| Theme mode | AgentforceThemeMode | SYSTEM, LIGHT, or DARK. |
Shapes, dimensions, and shadows come from the Salesforce SharedUI design system and can also be overridden through AgentforceThemeOverrides or createCustomAgentforceThemeManager(...), using the SharedUI Shapes, Dimensions, and Shadows types.
- You describe your theme with
AgentforceThemeOverrides(a sparse bag of just the tokens you want to change) or with a fully resolvedAgentforceThemeManager. - You pass it to
setTheming(...)using the sealedAgentforceThemingtype:Default,Overrides, orCustomManager. - The SDK resolves that into an
AgentforceThemeManagerand publishes it through theLocalAgentforceThemeComposeCompositionLocal. - Every component reads its values from that local, so the UI recomposes when the theme or the device’s light/dark setting changes.
Prefer AgentforceTheming.Overrides. A fully resolved manager carries no “unset” signal, so there is no way to say “leave this one alone.”
| Page | What it covers |
|---|---|
| Theming guide | End-to-end walkthrough: supplying a theme, then customizing colors, typography, icons, strings, and theme mode. |
| AgentforceThemeManager | The theme contract, the factory functions, and reading theme values in your own components. |
| AgentforceColors | The palette class, the default light and dark palettes, the AgentforceColorToken enum, and withOverrides(...). |
| Color Token Reference | Every one of the 271 color tokens, with its fallback and its default light and dark value. |
| AgentforceTypography | The 23 text styles with their weights, sizes, and line heights, plus copyWithFontFamily(...). |
| Custom Icons | Every replaceable icon, its default drawable, and which color token tints it. |
| Display Names | Every customizable string, its default text, and where it appears. |
| Theme Mode | Light, dark, or follow the system, and how each mode resolves. |
| Server-Driven Branding | How an org can supply a theme centrally, and how it merges with your in-code theme. |
If you’re coming from older documentation:
| Old name | Use instead |
|---|---|
AgentforceColors | Never a type — it was the file name. The types are AgentforceColorPalette, AgentforceLightColors, AgentforceDarkColors, and AgentforceColorToken. |
AgentforceThemeCreator | createDefaultAgentforceThemeManager() or createCustomAgentforceThemeManager(...). |
DefaultAgentforceTheme | createDefaultAgentforceThemeManager(). |
Typography (base class) | AgentforceTypography, with Typography.mergeWith(...) for per-style overrides. |
SalesforceTextFontScale | Internal to the SDK. Font scaling now follows the device’s font-scale setting automatically. |
AgentforceSpacing, Spacing, Spacing (Styles) | Internal to the SDK. Override spacing through the SharedUI Dimensions type instead. |
setThemeManager(...) / setThemeOverrides(...) | setTheming(...) with AgentforceTheming. |
AgentforceThemeManager is an interface with read-only accessors. You can’t construct it directly and there are no setter methods — build one with createCustomAgentforceThemeManager(...), which takes every theme property as a defaulted parameter.
- UI Components: See Android UI Components for component theming.
- Configuration: See Configuration Overview for setup.
- Integration: See Android Development for architecture patterns.