Add new channel item type
Channel differentiation allows for a more organized and intuitive channel list within your application. By customizing the channel list to accommodate different channel types, users can have a tailored experience that fits the unique needs of different groups or topics.
Create channel with custom data
First, define a new channel type that starts from 1001 and above. This is because Sendbird UIKit reserves channel types from 0 to 1000.
When creating new channel types, custom data may be necessary to differentiate messages. Before sending a channel, you can set its custom type and insert the necessary data for rendering the UI.
Draw new channel type
You can draw new channel items by inheriting from
ChannelListAdapter and implementing
getItemViewType(). This works in the same way as the Android's RecyclerView. Based on the custom type returned by the
getItemViewType() method, the adapter provides the corresponding custom ViewHolder to render the item's layout.
For an in-depth practical demonstration, see our sample code.