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

List channel participants

Copy link

A participant list is a complete list of users that are participants of an open channel. The participant list is created through ParticipantListActivity or ParticipantListFragment.


Channel participant list screen

Copy link

A channel participant list screen is composed of three components: header, participant list, and participant list status.

Header

Copy link

The header component shows the default title of the channel participant list screen as Participants. It also has a button on the left corner of the header. When the left button is tapped, the finish() method of the activity is called to exit the current screen. The view of the header is created and customized in the HeaderComponent of the ParticipantListModule.

Participant list

Copy link

The participant list component shows a list of profile images and names of the channel operators. The view of the participant list is created and customized in the ParticipantListComponent of the ParticipantListModule. You can also customize each item in the list view using ParticipantListAdapter.

Participant list status

Copy link

The participant list status component shows the result of the data request for a channel participant list. The StatusComponent exists in the ParticipantListModule 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 channel participant list 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 channel participant list screen through ParticipantListActivity, 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 ParticipantListActivity as shown below:

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

Create a fragment

Copy link

ParticipantListActivity allows you to create a basic ParticipantListFragment through UIKitFragmentFactory and ParticipantListFragment.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 ParticipantListFragment. To see all APIs of ParticipantListFragment.Builder, refer to the API reference page.

KotlinJava
val fragment = ParticipantListFragment.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 list channel participants key function, you can customize ParticipantListFragment to change different parts of the screen. The ParticipantListFragment.Builder class allows you to create and customize the basic ParticipantListFragment 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 ParticipantListFragment to display and customize the channel participant list screen.

FragmentModuleComponentStyleRecyclerView

ParticipantListFragment

ParticipantListModule

HeaderComponent

ParticipantListComponent

StatusComponent

Module.ParticipantList

ParticipantListAdapter

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 Customization 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 participant list, you must use the correct classes.