Themes
A theme is style that's applied to your entire app, activity, or view hierarchy rather than an individual view. It's composed of different styles used in modules and components. By default, Sendbird UIKit for Android provides two themes: Light
and Dark
. But you can customize these themes to create your own brand identity by changing the value of resources.
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.
Background color
The background color of each component in Light
theme ranges from Background-50
to Background-300
.
Texts and other element colors
The following image shows the color scheme used for texts and other elements on light backgrounds.
UI elements and status colors
Primary-main
and Secondary-main
colors are used to highlight UI elements such as icon buttons, outgoing message bubbles, and read receipt icons. Error-main
is used for warnings and Information-light
is currently used for a status banner indicating frozen channels.
Dark theme
A dark theme is a user interface designed for low-light environments, featuring primarily dark surfaces. It serves as an alternative option to the default light theme, presenting dark-colored surfaces throughout much of the interface.
The Dark
theme can be applied as below:
Background color
The background color of each component in Dark
theme ranges from Background-400
to Background-700
.
Texts and other element colors
The following image shows the color scheme used for texts and other elements on dark backgrounds.
UI elements and status colors
Primary-light
and Secondary-light
colors are used to highlight UI elements such as icon buttons, outgoing message bubbles, and read receipt icons. Error-light
is used for warnings and Information-light
is currently used for a status banner indicating frozen channels.
Theme anatomy
The images below show the combination of background and text colors used in the Light
and Dark
themes.
Light theme
Dark theme
States
The images below show the various colors used to indicate different states in the Light
and Dark
themes. For Pressed
and Selected
states, the background color is either Primary-light
or one level higher than that of the Enabled
state.
Light theme
Dark theme
Customize theme
A theme in UIKit is composed of various styles used in modules and components. To change them, you must inherit the style of the module you wish to customize and create a custom style first. Then, you can apply the new style to the theme. You can also set and customize individual component themes for when you want to use components outside of the set module. To learn more about style, go to the Style resource page.
Note : For dark theme, use
AppTheme.Dark.Sendbird
in the code. You can see all the different styles that are applied to the dark theme in theres/values/styles_dark.xml
file.
For an in-depth practical demonstration, see our sample code.