Skip to main content
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:

Toolbar Overflow Menu

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.