List banned users in open channel
A banned user list in an open channel is a complete list of users that are banned from the channel. Only an operator of the channel can ban users. The banned user list is created through OpenChannelBannedUserListActivity
or OpenChannelBannedUserListFragment
.
Banned user list screen
A banned user list screen is composed of three components: header, banned user list, and banned user list status.
Header
The header component shows the default title of the banned user list screen as Banned users
. 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 OpenChannelBannedUserListModule
.
Banned user list
The banned user list component shows a list of profile images and names of all banned users from the channel. The view of the banned user list in an open channel is created and customized in the BannedUserListComponent
of the OpenChannelBannedUserListModule
. You can also customize each item in the list view using OpenChannelBannedUserListAdapter
.
Banned user list status
The banned user list status component shows the result of the data request for a banned user list. The StatusComponent
exists in the OpenChannelBannedUserListModule
and lets the user know if the list is loading or if the list could not be called.
Usage
UIKit for Android provides both activity and fragment to create a banned user 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 banned user list screen through OpenChannelBannedUserListActivity
, which uses UIKitFragmentFactory
to create views.
Start an activity
You can start an activity by using intent
to move from one activity to OpenChannelBannedUserListActivity
as shown below:
Create a fragment
OpenChannelBannedUserListActivity
allows you to create a basic OpenChannelBannedUserListFragment
through UIKitFragmentFactory
and OpenChannelBannedUserListFragment.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 OpenChannelBannedUserListFragment
. To see all APIs of OpenChannelBannedUserListFragment.Builder
, refer to the API reference page.
Note: To use UIKit's fragments as a nested fragment, refer to the Android Developer Documentation's Nested Fragments.
Customization
In the list banned users in open channel key function, you can customize OpenChannelBannedUserListFragment
to change different parts of the screen. The OpenChannelBannedUserListFragment.Builder
class allows you to create and customize the basic OpenChannelBannedUserListFragment
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 OpenChannelBannedUserListFragment
to display and customize the banned user list screen.
Fragment | Module | Component | Style | RecyclerView |
---|---|---|---|---|
OpenChannelBannedUserListFragment | OpenChannelBannedUserListModule | HeaderComponent | Module.OpenChannelBannedUserList | OpenChannelBannedUserListAdapter |
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 banned user list, you must use the correct classes.