Skip to main content
The DataSource framework is the most powerful customization mechanism in the UI Kit. It lets you globally modify how messages are rendered, what options appear on message bubbles, what attachment actions are available in the composer, and how text is formatted — all without touching individual components.

DataSource Interface

The DataSource interface defines how the UI Kit provides:
  • Message templates (how each message type is rendered)
  • Bubble content views (the actual views inside message bubbles)
  • Message options (actions on message bubbles like reply, copy, delete)
  • Attachment options (composer actions like camera, gallery, file)
  • AI options (AI-powered composer actions)
  • Text formatters (text processing for mentions, links, etc.)

DataSourceDecorator Pattern

DataSourceDecorator is an abstract class that wraps a DataSource and delegates all method calls to it. You extend it and override only the methods you want to customize. This is the decorator pattern — you layer behavior on top of the existing implementation.

ChatConfigurator

ChatConfigurator manages the active DataSource instance: You can chain multiple decorators by calling enable multiple times. Each call wraps the previous DataSource.

Example: Adding a Custom Message Option

Create a DataSourceDecorator that adds a “Translate” option to all text messages:

Message Template Methods

Message templates define how each message type is rendered. Override these to add custom message types or modify existing ones:

Bubble Content View Methods

Each message type has a pair of methods following the createView / bindView pattern: The get* method creates the View (called once per ViewHolder), and the bind* method populates it with data (called on each bind). Override these to completely replace how a message type is rendered inside its bubble.

Other DataSource Methods