UIKit Android v3
UIKit Android
UIKit
Android
Home
/
UIKit
/
Android
This is the new Docs for UIKit v3 beta for Android. To see the previous Docs, click here.

Configure group channel settings

You can configure the settings of each group channel. Customizable settings include channel name, cover image, and notifications. You can also search messages with a keyword and leave the channel.


Group channel settings screen

A group channel settings screen is composed of three components: header, channel information, and settings menu.

Header

The header component shows the default title of the group channel settings screen as channel information. 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, a dialog appears asking if the user would like to change the channel's cover image and name. The view of the header is created and customized in the ChannelSettingsHeaderComponent of the ChannelSettingsModule.

Channel information

The channel information component shows the channel's cover image and name by default. The view of the channel information is created and customized in the ChannelSettingsInfoComponent of the ChannelSettingsModule.

Settings menu

The settings menu shows different configuration options and features of the channel that you can set. The menu includes moderation, notifications, members, search in channel, and leave channel. The view of the settings menu is created and customized in the ChannelSettingsMenuComponent of the ChannelSettingsModule.


Usage

UIKit for Android provides both activity and fragment to create a group channel settings 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 group channel settings screen through ChannelSettingsActivity, which uses UIKitFragmentFactory to create views.

Start an activity

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

Intent intent = ChannelSettingsActivity.newIntent(context, "channel_url");
startActivity(intent);

Create a fragment

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

ChannelSettingsFragment fragment = new ChannelSettingsFragment.Builder("channel_url").build();

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


Customization

In the configure group channel settings key function, you can customize ChannelSettingsFragment to change different aspects of the screen. The ChannelSettingsFragment.Builder class allows you to create and customize the basic ChannelSettingsFragment 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 ChannelSettingsFragment to display and customize the group channel settings screen.

FragmentModuleComponentStyle

ChannelSettingsFragment

ChannelSettingsModule

ChannelSettingsHeaderComponent

ChannelSettingsInfoComponent

ChannelSettingsMenuComponent

Module.ChannelSettings

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, follow the links to Customization listed below:

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