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

List channel members

Copy link

A member list is a complete list of users that are members of a group channel. The channel member list is created through MemberListActivity or MemberListFragment.


Channel member list screen

Copy link

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

Header

Copy link

The header component shows the default title of the channel member list screen as Members. 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 invite user screen is called where you can add new users to the channel. The view of the header is created and customized in the HeaderComponent of the MemberListModule.

Member list

Copy link

The member list component shows a list of profile images and names of all members of the channel. For channel operators, the status Operator is displayed next to the name. The view of the member list is created and customized in the MemberListComponent of the MemberListModule. You can also customize each item in the list view using MemberListAdapter.

Member list status

Copy link

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

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

Create a fragment

Copy link

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

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

FragmentModuleComponentStyleRecyclerView

MemberListFragment

MemberListModule

HeaderComponent

MemberListComponent

StatusComponent

Module.MemberList

MemberListAdapter

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