This tutorial outlines some major Activities and Fragments available to customize the Android UIKit. Please note that this is a compilation of only the most common Activities and Fragments that you can customize.
The general design behind the UIKit is split into Fragments and Activities. In Android, an Activity is a UI component used to build a single screen of an application. It is the main focus of attention on the screen. In an Activity, you can build fragments and set the UI elements, listeners, adapters, queries, etc.
A Fragment is a sub-activity. A Fragment has its own lifecycle, inputs and can be added or removed from an Activity. A Fragment contains any additional code you want to implement, including adapters, event handlers, etc.
For all Activities and Fragments, Sendbird provides you with a default implementation if you do not implement your custom Activities and Fragments. Don’t forget that to launch the UIKit, you will need the ChannelListActivity, as ChannelListActivity is the starting point for launching the UIKit in your application.
This guide assumes some knowledge of Android and Java. All code snippets come from the official sample app.
In this tutorial, we will cover how to customize:
Let’s dive in!
To customize the ChannelListActivity, you will need an Activity such as the following. In this activity, the most critical part is the method: createChannelListFragment. It allows you to:
CustomChannelListActivity
CustomChannelListFragment
Fragments contain the bulk of the code in terms of implementation. The gist below shows the many different methods you can implement from the ChannelListFragment. This includes:
The rest can be seen in the following gist:
To customize the ChannelActivity, you will need an Activity like the following. All Activities and Fragments which are customized follow the same general flow as you can see in the snippets. In this Activity, the most important part is the method: createChannelFragment. This allows you to:
A full list of customization options follows.
CustomChannelActivity
CustomChannelFragment
The following gist shows the many different methods you can implement from the ChannelFragment. This includes:
The rest can be seen in the following gist:
To customize the MemberListActivity, you will need an Activity like the following. All Activities and Fragments which are customized follow the same general flow as you can see in the snippets. In this Activity, the most critical part is the method: createMemberListFragment. it allows you to:
The complete list of customization options is below.
CustomMemberListActivity
CustomMemberListFragment
The following gist shows the different methods you can implement from the ChannelListFragment. This includes things like:
To customize the ChannelSettingsActivity, you will need an Activity like the following. All Activities and Fragments which are customized follow the same general flow as you can see in the snippets. In this Activity, the most critical part is the method: createChannelSettingsFragment. This allows you to:
A full list of customization options follows.
CustomChannelSettingsActivity
CustomChannelSettingsFragment
The following gist shows the many different methods you can implement from the ChannelListFragment. This includes things like:
The rest can be seen in the following gist:
To customize the InviteChannelActivity, you will need an Activity like the following. All Activities and Fragments which are customized follow the same general flow as you can see in the snippets. In this Activity, the most critical part is the method: createInviteChannelFragment. This allows you to:
The full list of customization options is below.
CustomInviteChannelActivity
CustomInviteChannelFragment
The following gist shows the many different methods you can implement from the createChannelFragment. This includes things like:
To customize the CreateChannelActivity, you will need an Activity like the following. All Activities and Fragments which are customized follow the same general flow as you can see in the snippets. In this Activity, the most critical part is the method: createChannelFragment. This allows you to:
The full list of customization options is below.
CustomCreateChannelActivity
CustomCreateChannelFragment
The Fragments are where the bulk of the code in terms of implementation will reside. The following gist shows the many different methods you can implement from the createChannelFragment. This includes things like:
The rest can be seen in the following gist:
By default, Sendbird provides a beautiful user interface with light or dark themes. To further customize and specify the exact colors to be used with both light and dark themes, you can use our UIKit color set guide. This document will help you set harmonious colors and contrast levels between the backgrounds and chat UI components.
This tutorial outlined the major Activities and Fragments available in the Android UIKit. For additional UI modifications, check the docs for the full list of customizable themes as well as how to change common resources such as Strings, Icons, and other Styles.
You are on your way to creating a beautiful chat experience! Keep it going, and happy custom chat building! 🙂
Stay up-to-date on the latest technical content from Sendbird.
Thank You for registering!