Skip to main content
Every component in the Android UI Kit follows a three-layer architecture. Understanding these layers is the key to unlocking deep customization without rebuilding components from scratch.

Architecture

Each component is composed of three collaborating classes:
LayerRoleExample Class
ViewRenders the UI, handles user interaction, and exposes setter methods for customization.CometChatConversations
ViewModelManages data fetching, state, and business logic via LiveData.ConversationsViewModel
AdapterBinds data to RecyclerView items and controls how each list row is rendered.ConversationsAdapter

Accessing Internal Layers

The View layer provides accessor methods to reach the other layers:
MethodReturnsPurpose
getViewModel()ConversationsViewModelAccess the ViewModel to observe LiveData, call mutation methods, or configure request builders.
getConversationsAdapter()ConversationsAdapterAccess the Adapter to manipulate list data or set view slots directly on the adapter.
getRecyclerView()RecyclerViewAccess the underlying RecyclerView for scroll listeners, layout manager changes, or item decorations.
getBinding()CometchatConversationsListViewBindingAccess the ViewBinding for direct manipulation of the component’s internal views.
val conversations = CometChatConversations(context)

// Access the ViewModel
val viewModel = conversations.getViewModel()

// Access the Adapter
val adapter = conversations.getConversationsAdapter()

// Access the RecyclerView
val recyclerView = conversations.getRecyclerView()

Customization Categories

The UI Kit provides eight categories of customization entry points. Each category has a dedicated guide: For global-level customization that spans across all message types and components, see the DataSource & ChatConfigurator guide.

What’s Next

If you’re new to customization, start with View Slots for quick UI changes, or Styles to match your brand. For advanced use cases like custom message types or global behavior changes, head to DataSource & ChatConfigurator.