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.

Quick start

Supply a theme once, through AgentforceConfiguration.Builder.setTheming(...). List only the tokens you want to change; everything else keeps its SDK default.

import androidx.compose.ui.graphics.Color
import com.salesforce.android.agentforcesdk.components.theme.AgentforceColorToken
import com.salesforce.android.agentforcesdk.components.theme.AgentforceThemeMode
import com.salesforce.android.agentforcesdk.components.theme.AgentforceThemeOverrides
import com.salesforce.android.agentforcesdk.components.theme.AgentforceTheming

val theming = AgentforceTheming.Overrides(
    AgentforceThemeOverrides(
        lightColors = mapOf(AgentforceColorToken.Accent1 to Color(0xFF0170CB)),
        darkColors = mapOf(AgentforceColorToken.Accent1 to Color(0xFF008AF7)),
        themeMode = AgentforceThemeMode.SYSTEM,
    )
)

val configuration = AgentforceConfiguration.builder(authCredentialProvider)
    .setApplication(application)
    .setSalesforceDomain("https://your-instance.salesforce.com")
    .setTheming(theming)
    .build()

What you can customize

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.

How the pieces fit together

  1. You describe your theme with AgentforceThemeOverrides (a sparse bag of just the tokens you want to change) or with a fully resolved AgentforceThemeManager.
  2. You pass it to setTheming(...) using the sealed AgentforceTheming type: Default, Overrides, or CustomManager.
  3. The SDK resolves that into an AgentforceThemeManager and publishes it through the LocalAgentforceTheme Compose CompositionLocal.
  4. 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."

Reference pages

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.

Renamed and removed types

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.

See also