Chat UIKit Android View v3
Chat UIKit Android View
Chat UIKit
Android View
Version 3

Register members as operators

Copy link

Operators can register other channel members as operators through the RegisterOperatorActivity or RegisterOperatorFragment. All channel members are listed through pagination and members who are already an operator can't be registered.


Register members as operators screen

Copy link

A register members as operators screen is composed of three components: header, user list, and user list status.

Header

Copy link

The header component shows the default title of the register members as operators screen as Register as operator. It also has two buttons on the left and right corner of the header. When the left button is tapped, the finish() method of the activity is called to exit the current screen. When the right button is tapped, the selected members are registered to be operators of the channel. The view of the header is created and customized in the SelectUserHeaderComponent of the RegisterOperatorModule.

User list

Copy link

The user list component shows a list of channel members' profile images, names, and selectable checkboxes. By default, all channel members are retrieved in the list. However, members that are already an operator of the channel can't be selected from the list. The view of the user list is created and customized in the RegisterOperatorListComponent of the RegisterOperatorModule. You can also customize each item in the list view using RegisterOperatorListAdapter.

User list status

Copy link

The user list status component shows the result of the data request for a channel member list. The StatusComponent exists in the RegisterOperatorModule and lets the user know if the list is loading or if the list could not be called.


UIKit for Android provides both activity and fragment to create a register members as operators screen. You can choose which one to build your app with and you may solely use activity instead of fragment if you wish to. You can build a register members as operators screen through RegisterOperatorActivity, which uses UIKitFragmentFactory to create views.

Start an activity

Copy link

You can start an activity by using intent to move from one activity to RegisterOperatorActivity as shown below:

KotlinJava
val intent = RegisterOperatorActivity.newIntent(context, "channel_url")
startActivity(intent)

Create a fragment

Copy link

RegisterOperatorActivity allows you to create a basic RegisterOperatorFragment through UIKitFragmentFactory and RegisterOperatorFragment.Builder. UIKitFragmentFactory has a set of methods that build each fragment, whereas the builder class provides APIs to customize the UI of the data and event handlers used in RegisterOperatorFragment. To see all APIs of RegisterOperatorFragment.Builder, refer to the API reference page.

KotlinJava
val fragment = RegisterOperatorFragment.Builder("channel_url").build()

Note: To use UIKit's fragments as a nested fragment, refer to the Android Developer Documentation's Nested Fragments.


Customization

Copy link

In the register as operator key function, you can customize RegisterOperatorFragment to change different aspects of the screen. The RegisterOperatorFragment.Builder class allows you to create and customize the basic RegisterOperatorFragment that UIKit provides but you can only change its own APIs, such as setting a layout. If you wish to customize the fragment beyond using the APIs provided in the builder, you must inherit new customization methods.

The following table shows the main classes used in RegisterOperatorFragment to display and customize the register members as operators screen.

FragmentModuleComponentStyleRecyclerView

RegisterOperatorFragment

RegisterOperatorModule

SelectUserHeaderComponent

RegisterOperatorListComponent

StatusComponent

Module.RegisterOperator

RegisterOperatorListAdapter

Depending on the UI or the feature you wish to customize in the fragment, you can change the classes mentioned in the table. To learn how to customize the fragment, see the Customizations overview page for further details.

Note: The links to the above Customization pages provide an example of how to customize classes related to ChannelFragment. In order to make changes to the register members as operators screen, you must use the correct classes.