Android
UIKit Themes

Themes

A theme is style that’s applied to your entire app, activity or view hierarchy rather than an individual view. By default, Sendbird UIKit for Android provides two themes: Light and Dark. Customized themes that fit your brand identity can also be created by changing the style and color set.


Setup the default theme

UIKit for Android's Light or Dark theme can be applied using the SendBirdUIKit.setDefaultThemeMode() method.

Light theme

This is the default theme for UIKit if another theme hasn’t been specified.

Light Color Skin
Copy
SendBirdUIKit.setDefaultThemeMode(SendBirdUIKit.ThemeMode.Light);

ThemeLight

Dark theme

The Dark theme can be applied as below:

Light Color Skin
Copy
SendBirdUIKit.setDefaultThemeMode(SendBirdUIKit.ThemeMode.Dark);

ThemeDark


StyleSet

StyleSet is the list of styles provided by UIKit. Customizing the style of channel list items is straightforward: Simply inherit the UIKit-defined styles, then override the res/values/styles.xml file from the list below. For example, the ChannelPreview theme can be changed by overriding the Widget.SendBird.ChannelPreview.

Note : To apply our Dark theme, create a res/values/styles_dark.xml file and then add .Dark to the UIKit-defined style names.

Light Color Skin
Copy
<style name="SendBird" parent="AppTheme">
    <item name="sb_channel_preview_style">@style/Widget.SendBird.ChannelPreview</item>
    <item name="sb_user_preview_style">@style/Widget.SendBird.UserPreview</item>
    <item name="sb_channel_settings_style">@style/Widget.SendBird.ChannelSettings</item>
    <item name="sb_channel_message_list_style">@style/Widget.SendBird.RecyclerView.Message</item>
    <item name="sb_message_user_style">@style/Widget.SendBird.Message.User</item>
    <item name="sb_message_file_style">@style/Widget.SendBird.Message.File</item>
    <item name="sb_message_admin_style">@style/Widget.SendBird.Message.Admin</item>
    <item name="sb_message_timeline_style">@style/Widget.SendBird.Message.Timeline</item>
    <item name="sb_message_input_style">@style/Widget.SendBird.MessageInput</item>
    <item name="sb_appbar_style">@style/Widget.SendBird.AppBar</item>
    <item name="sb_recycler_view_style">@style/Widget.SendBird.RecyclerView</item>
    <item name="sb_dialog_view_style">@style/Widget.SendBird.DialogView</item>
    <item name="sb_status_frame_style">@style/Widget.SendBird.StatusFrame</item>
    <item name="sb_toast_view_style">@style/Widget.SendBird.ToastView</item>
    <item name="sb_button_contained_style">@style/Widget.SendBird.Button.Contained</item>
    <item name="sb_button_uncontained_style">@style/Widget.SendBird.Button.Uncontained</item>
    <item name="sb_button_warning_style">@style/Widget.SendBird.Button.Alert</item>
    <item name="sb_button_cancel_style">@style/Widget.SendBird.Button.Cancel</item>
    <item name="sb_icon_button_style">@style/Widget.SendBird.IconButton</item>
</style>

Listed below are the detailed style components of each Activity or Fragment:

Activity or FragmentStyle components

ChannelList

Widget.SendBird.ChannelPreview

Channel

Widget.SendBird.RecyclerView.Message, Widget.SendBird.Message.User, Widget.SendBird.Message.File, Widget.SendBird.Message.Admin, Widget.SendBird.Message.Timeline, Widget.SendBird.MessageInput

CreateChannel, InviteChannel, MemberList

Widget.SendBird.UserPreview

ChannelSettings

Widget.SendBird.ChannelSettings

CommonComponents

Widget.SendBird.AppBar, Widget.SendBird.RecyclerView, Widget.SendBird.DialogView, Widget.SendBird.StatusFrame, SendBird.ProgressBar, Widget.SendBird.ToastView, Widget.SendBird.Button.Contained, Widget.SendBird.Button.Uncontained, Widget.SendBird.Button.Alert, Widget.SendBird.Button.Cancel, Widget.SendBird.IconButton


ColorSet

The ColorSet is the set of colors provided by UIKit for Android and is fully customizable.

Light Color Skin
Copy
<?xml version="1.0" encoding="utf-8"?>
<resources>
    <color name="primary_500">#4d2aa6</color>
    <color name="primary_400">#6440c4</color>
    <color name="primary_300">#7b53ef</color>
    <color name="primary_200">#9e8cf5</color>
    <color name="primary_100">#e2dfff</color>
    <color name="secondary_500">#007a7a</color>
    <color name="secondary_400">#189a8d</color>
    <color name="secondary_300">#2eba9f</color>
    <color name="secondary_200">#6fd6be</color>
    <color name="secondary_100">#aef2dc</color>
    <color name="error">#e53157</color>
    <color name="background_700">#000000</color>
    <color name="background_600">#161616</color>
    <color name="background_500">#2c2c2c</color>
    <color name="background_400">#393939</color>
    <color name="background_300">#a8a8a8</color>
    <color name="background_200">#f0f0f0</color>
    <color name="background_100">#ffffff</color>
    <color name="onlight_01">#e1000000</color>
    <color name="onlight_02">#80000000</color>
    <color name="onlight_03">#61000000</color>
    <color name="onlight_04">#1e000000</color>
    <color name="ondark_01">#e1ffffff</color>
    <color name="ondark_02">#80ffffff</color>
    <color name="ondark_03">#61ffffff</color>
    <color name="ondark_04">#1effffff</color>
    <color name="overlay_01">#8c000000</color>
    <color name="overlay_02">#51000000</color>
</resources>