Sendbird UIKit for Android allows you to customize its modules and components. In this documentation, we will guide you on how to customize and apply these modules and components within the Sendbird UIKit framework.
In the context of Sendbird UIKit, modules organize the UI of an Activity, and components are parts of these modules. For instance, a ChannelModule organizes and manages the UI of a channel screen, while a component such as the ChannelHeaderComponent represents the visual header of a channel.
This separation allows for the following:
Flexibility: Customize specific parts without affecting the entire module.
Reusability: Use the same component across different modules.
Efficiency: Apply common styles or functionalities at the module or component level.
A module is responsible for assembling and rendering the UI that a Fragment needs to display. Fragments not only provide data to the module (UI) but also handle additional functionalities of the Android platform such as permissions and lifecycle.
To customize a module or its components, you can inherit from the module of component class and override its methods. In the sample code, a custom class CustomChannelModule is defined that inherits from ChannelModule. It doesn't add any new functionality but serves as a placeholder for potential customization.
class CustomChannelModule(context: Context) : ChannelModule(context)
In the sample code below, another custom class CustomHeaderComponent is defined, which inherits from ChannelHeaderComponent. This class customizes the way the channel header view is created by overriding the onCreateView method.
The following table shows a list of UIKit's modules and its components. When customizing all modules and components, they should be provided in the correct form for each type.
You can set customized modules and components globally within the UIKit framework using the ModuleProviders.
See the full list of Modules provided in the Sendbird UIKit.
Each time a module for the same screen is created, it uses the same Module class. Additionally, each ModuleProvider for the module provides the arguments needed. It's recommended to set this up within the onCreate() method of your Application as shown in the code below.