UI Configuration - Texts, Localization, Colors and Features
mesibo UI modules can be configured to match the look and the features of an app, without changing
the screens themselves. Every text, color and image of the messaging UI, and every feature that can be
turned on or off, is an option of one configuration object, MesiboUiConfig.
The configuration is organized in groups, one for each screen or part of the UI, for example userList
for the chat list and messages for the chat screen. The names are the same on Android, iOS and
Flutter, and the same names are used in JSON, so one configuration can be shared by all the apps.
The configuration is described on the following pages.
Themes and Colors
The colors of the light and the dark theme, the text size, and the chat wallpaper. This page also describes how the users of the app choose their own look in the Customize screen, and how the app saves that look and restores it on other devices. See Themes and Colors.
Chat List
The list of one-to-one and group chats: its title, where the search field is, the filters above the chats (unread, favorites, groups, online), archived chats, swipe actions, drafts and the profile popup. See Chat List.
Chat Screen
The conversation: which actions a message has (reply, forward, edit, copy, star, keep, reactions), attachments and the photo editor, the size of pictures sent, message options, disappearing messages, the icons by the time of a message, message info, and the photo and video viewer. See Chat Screen.
Profiles
The profile screen of a user profile or a group profile, multiple profile photos and how users manage them, and the media, documents and links of a chat. See Profiles.
Privacy and Security
The end-to-end encryption screens, and sensitive messages: messages that stay covered until opened, and that cannot be forwarded, copied, kept or captured. See Privacy and Security.
Configuration as JSON
How to write the configuration as JSON, apply a JSON sent from the app’s server, export the current configuration, and check a JSON with the JSON Schema. See Configuration as JSON.
Migrating from 2.9.0
An app moving from mesibo 2.9.0, or any later version, to the latest messaging UI: the new name of
every option of MesiboUiDefaults and of the earlier MesiboUiConfig. See
Migrating from 2.9.0.
Setting the configuration
The app sets the configuration before it opens the messaging screens:
- It selects the theme with
setTheme: light or dark. - It gets the configuration with
getConfig. - It changes the options it needs.
The screens opened after that use the new options. An app that follows the system’s light or dark setting instead, the default, sets its options as described in Automatic Theme Changes.
MesiboUI.setTheme(MesiboUI.THEME_LIGHT);
MesiboUiConfig config = MesiboUI.getConfig();
config.userList.title = "Chats";
config.userList.enableFilters = false;
config.messages.enableForward = false;
config.profileViewer.showAddress = true;
MesiboUI.setTheme(MesiboUI.THEME_LIGHT)
val config = MesiboUI.getConfig()
config.userList.title = "Chats"
config.userList.enableFilters = false
config.messages.enableForward = false
config.profileViewer.showAddress = true
MesiboUI.setTheme(MESIBO_THEME_LIGHT)
let config = MesiboUI.getConfig()
config.userList.title = "Chats"
config.userList.enableFilters = false
config.messages.enableForward = false
config.profileViewer.showAddress = true
[MesiboUI setTheme:MESIBO_THEME_LIGHT];
MesiboUiConfig *config = [MesiboUI getConfig];
config.userList.title = @"Chats";
config.userList.enableFilters = NO;
config.messages.enableForward = NO;
config.profileViewer.showAddress = YES;
MesiboUI().setTheme(MesiboUI.THEME_LIGHT);
MesiboUiConfig config = await MesiboUI().getConfig();
config.userList.title = "Chats";
config.userList.enableFilters = false;
config.messages.enableForward = false;
config.profileViewer.showAddress = true;
await MesiboUI().setConfig(config);
{
"userList": {"title": "Chats", "enableFilters": false},
"messages": {"enableForward": false},
"profileViewer": {"showAddress": true}
}
The same options can also be applied as JSON, for example from the app’s server. See Configuration as JSON.
Automatic Theme Changes
The options set with getConfig are kept until a theme is applied again. Each time a theme is
applied, mesibo makes a new configuration from the theme’s defaults, and the options set before are
lost. When the app applies a theme itself, with setTheme or applyCustomization, it sets its
options again right after, the same way.
mesibo applies a theme on its own in two cases only:
- The app follows the system’s light or dark setting (
THEME_SYSTEM, the default), and the system switches between light and dark. - The user applies or resets a look in mesibo’s Customize screen.
The app is not involved in these, so it cannot set its options again itself. An app in either case
sets its options in MesiboUI_onConfig of its UI listener instead. mesibo calls it each time it makes
a new configuration, the first time included, so the app does not also set them with getConfig. The
app registers its listener before it uses the configuration or opens a screen. See
Configuration Callback.
Even an app that does not use the Customize screen is recommended to implement the configuration callback and set its options there. The app can then follow the system’s light or dark setting, as users expect, and its options are applied to both themes, for the best user experience.
In Flutter, mesibo keeps the options applied with setConfig and applies them again to each new
configuration, so Flutter apps do not need a callback.
Customizations
The users of the app can choose their own look in the Customize screen. The look is saved as a customization, a JSON of options for the light or the dark theme, which mesibo applies each time that theme is applied. The app can also save a customization from its server. See Customizations.
Configuration Groups
| Group | Configuration of |
|---|---|
theme | colors and pictures shared by all screens: toolbar, accent color, letter avatars |
common | texts used on several screens: Cancel, Today, online, typing…, You |
userList | the chat list: title, search, filters, archived chats, drafts, the profile popup |
contacts | the contact lists: new chat, forward, group members, Enter number |
messages | the chat screen: the actions on a message (reply, forward, edit, copy, star, keep, reactions) and their texts |
messageAppearance | the look of the chat: bubbles, text size, spacing, wallpaper |
attachments | the attach button, the camera button, the tiles of the attachment sheet |
imageSending | the size of pictures sent |
messageOptions | the message options sheet: disappear after, expiry, sensitivity |
messageInfo | the message info screen: when a message was delivered and read |
messageStatus | the icons by the time of a message, and the texts of a message that could not be sent |
voiceMessages | recording and playing voice messages |
location | sharing a location (Android only) |
profileViewer | the profile screen of a user profile or a group profile |
profileEditor | the editor of the user profile and of group profiles, and their photos |
groups | creating and editing groups, and their members |
disappearing | the disappearing messages screen |
encryption | the end-to-end encryption screens |
mediaPicker | picking photos, videos and files |
imageEditor | the photo editor |
sensitivity | sensitive messages |
Each option has a description in the IDE.
Naming Convention
The names follow one convention, the same on Android and iOS:
| Name | Meaning | Example |
|---|---|---|
enableX | A feature the user can use. Off removes it from every screen | messages.enableForward |
enabled | A whole group on or off | attachments.enabled |
showX | Display only. Off hides information; no action is lost | profileViewer.showLastSeen |
XTitle | A short text: a button, a label, a title or a heading | messages.forwardTitle |
XMessage | A sentence: an explanation, an empty list, an error | userList.emptySearchMessage |
XHint | The placeholder of an input field | userList.searchHint |
XColor | A color, 0xAARRGGBB | messageStatus.readColor |
XImage, XImageResource | The app’s own picture: a UIImage on iOS, a drawable resource on Android | attachments.buttonImage |
XLevel | A sensitivity threshold. 0 is off | sensitivity.blockCopyLevel |
maxX | A limit | profileEditor.maxPhotos |
An option’s name does not repeat the group’s name: messageInfo.title, not
messageInfo.messageInfoTitle.
A list of choices is a list of MesiboUiOption. Each MesiboUiOption has a value, a title,
and an optional detail. Example: imageSending.sizes.
A title set to null (nil) or empty is not displayed.
Differences between Android and iOS
| Item | Android | iOS |
|---|---|---|
| The app’s own pictures | a drawable resource; the name ends in Resource, for example attachments.buttonImageResource | a UIImage, for example attachments.buttonImage |
| The keyboard of the Enter number field | contacts.enterAddressInputType, an InputType | contacts.enterAddressKeyboard, a UIKeyboardType |
The location group | map tiles, static maps, zoom and their texts | not present; the location picker of MediaPicker is used |
| Placeholders in texts | %s, %d | %@, %d |
| Swipe actions | a full swipe does one action | a swipe shows buttons |
| Color choice in the Customize screen | a grid of colors and a color code field | the system color picker |
| Folder of wallpaper photos | files/mesiboui | Application Support/MesiboUI |