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:

  1. It selects the theme with setTheme: light or dark.
  2. It gets the configuration with getConfig.
  3. 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

GroupConfiguration of
themecolors and pictures shared by all screens: toolbar, accent color, letter avatars
commontexts used on several screens: Cancel, Today, online, typing…, You
userListthe chat list: title, search, filters, archived chats, drafts, the profile popup
contactsthe contact lists: new chat, forward, group members, Enter number
messagesthe chat screen: the actions on a message (reply, forward, edit, copy, star, keep, reactions) and their texts
messageAppearancethe look of the chat: bubbles, text size, spacing, wallpaper
attachmentsthe attach button, the camera button, the tiles of the attachment sheet
imageSendingthe size of pictures sent
messageOptionsthe message options sheet: disappear after, expiry, sensitivity
messageInfothe message info screen: when a message was delivered and read
messageStatusthe icons by the time of a message, and the texts of a message that could not be sent
voiceMessagesrecording and playing voice messages
locationsharing a location (Android only)
profileViewerthe profile screen of a user profile or a group profile
profileEditorthe editor of the user profile and of group profiles, and their photos
groupscreating and editing groups, and their members
disappearingthe disappearing messages screen
encryptionthe end-to-end encryption screens
mediaPickerpicking photos, videos and files
imageEditorthe photo editor
sensitivitysensitive messages

Each option has a description in the IDE.

Naming Convention

The names follow one convention, the same on Android and iOS:

NameMeaningExample
enableXA feature the user can use. Off removes it from every screenmessages.enableForward
enabledA whole group on or offattachments.enabled
showXDisplay only. Off hides information; no action is lostprofileViewer.showLastSeen
XTitleA short text: a button, a label, a title or a headingmessages.forwardTitle
XMessageA sentence: an explanation, an empty list, an erroruserList.emptySearchMessage
XHintThe placeholder of an input fielduserList.searchHint
XColorA color, 0xAARRGGBBmessageStatus.readColor
XImage, XImageResourceThe app’s own picture: a UIImage on iOS, a drawable resource on Androidattachments.buttonImage
XLevelA sensitivity threshold. 0 is offsensitivity.blockCopyLevel
maxXA limitprofileEditor.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

ItemAndroidiOS
The app’s own picturesa drawable resource; the name ends in Resource, for example attachments.buttonImageResourcea UIImage, for example attachments.buttonImage
The keyboard of the Enter number fieldcontacts.enterAddressInputType, an InputTypecontacts.enterAddressKeyboard, a UIKeyboardType
The location groupmap tiles, static maps, zoom and their textsnot present; the location picker of MediaPicker is used
Placeholders in texts%s, %d%@, %d
Swipe actionsa full swipe does one actiona swipe shows buttons
Color choice in the Customize screena grid of colors and a color code fieldthe system color picker
Folder of wallpaper photosfiles/mesibouiApplication Support/MesiboUI