This guide provides step-by-step instructions on customizing ChannelHeaderComponent. All components of Sendbird UIKit for Android can be also customized in a similar manner.
Reflect the newly created component within the Module. It's recommended to set up the Module changes using the Provider in the Application's onCreate() method.
If using a typing indicator, the description will contain information regarding the typing status. To pass additional information, call the notifyHeaderDescriptionChanged method.
KotlinJava
class CustomChannelHeaderComponent : ChannelHeaderComponent() {
var binding: ViewCustomHeaderBinding? = null
override fun onCreateView(context: Context, inflater: LayoutInflater, parent: ViewGroup, args: Bundle?): View {
binding = ViewCustomHeaderBinding.inflate(inflater, parent, false)
return requireNotNull(binding).root
}
override fun notifyChannelChanged(channel: GroupChannel) {
binding?.title?.text = channel.name
}
override fun notifyHeaderDescriptionChanged(description: String?) {
binding?.description?.visibility = if (description.isNullOrEmpty()) View.GONE else View.VISIBLE
binding?.description?.text = description
}
}
For an in-depth practical demonstration, see our sample code.