Customize UIKitFragmentFactory
UIKitFragmentFactory
is a class that provides and manages all fragments used in Sendbird UIKit. While an activity creates the basic UI screen and allows the user to navigate between different screens, the fragment within the activity is what allows you to customize components and manage data. The UIKitFragmentFactory
class creates the fragment used in each activity.
If you wish to customize a fragment, you need to inherit the UIKitFragmentFactory
class and override the method that creates the fragment. Then, you must return the customized fragment in order to apply the customization throughout the UIKit. Before creating the fragment, you need to also send data from the activity to the customized fragment through the Bundle
class. The fragment will then use the data to build a view.
Note: If you're only using fragments to build a screen in UIKit instead of using an activity, you can skip the following steps.
- You need to first override the methods of the fragment you wish to customize by inheriting the
UIKitFragmentFactory
class. Refer to the code below as an example.
- Apply the customized
UIKitFragmentFactory
toApplication
usingSendbirdUIKit.setUIKitFragmentFactory(UIKitFragmentFactory)
.