View Slots let you swap out specific parts of a componentโs list item โ the avatar area, title, subtitle, trailing section, or the entire row โ while keeping the rest of the componentโs behavior intact.
The ViewHolderListener Pattern
Every list-based component defines a ViewHolderListener abstract class (e.g., ConversationsViewHolderListener) with two callbacks:
Available View Slots
Slot-Level vs Full Item Replacement
Use slot-level setters (setLeadingView, setTitleView, setSubtitleView, setTrailingView) when you want to customize one region while keeping the default layout for everything else. Use setItemView when you need complete control over the entire row layout.
When you use setItemView, all other slot setters are ignored since the entire row is replaced.
Example: Custom Leading View
Replace the default avatar with a custom view that shows the first letter of the conversation name in a colored circle:
Example: Custom Subtitle View
Show a โtypingโฆโ indicator or a custom last message format in the subtitle area:
Use setOverflowMenu(View) to inject a custom view into the componentโs toolbar area. This is separate from the list item view slots โ it customizes the toolbar, not individual rows.