UIKit Android v3
UIKit Android
UIKit
Android
Version 3
Home
/
UIKit
/
Android
/
Customization
Add new APIs to the fragment
Copy link
The ViewModel
updates and manages APIs used in the fragment. It communicates with Sendbird Chat SDK to receive necessary data. If you wish to customize these data and implement new APIs, you can do so through the ViewModel
.
Note: The
ViewModel
ofChannelFragment
is used as an example in the codes below to show how to customize it but you can replace it with any otherViewModel
in UIKit.
- You can add or override new methods by inheriting
ChannelViewModel
.
- Create
CustomChannelViewModel
throughViewModelFactory
.
- Create a custom
ViewModel
by overriding theonCreateViewModel()
method of the custom fragment.
You can use the newly customized ViewModel
by calling the getViewModel()
method of the custom fragment.