Messaging UI - Chat Screen Configuration
The chat screen is where users read and send messages. mesibo lets the app choose which actions a message has, what users can attach and send, how pictures are edited before they are sent, and how messages are shown.
The configuration of the chat screen is described in the following sections:
- Features: the actions on a message, such as reply, forward, edit, copy, star, keep and reactions, and voice messages.
- Attachments: the attach button, the camera button and the tiles of the attachment sheet.
- Media picker and photo editor: picking photos and videos, the photo editor, and the size of pictures sent.
- Message options: when a message disappears or expires, and its sensitivity.
- Disappearing messages: the disappearing messages screen of a chat.
- Message status: the icons by the time of a message.
- Message info: when a message was delivered and read, by each member of a group.
- Photo and video viewer: viewing the photos and videos of a chat full screen.
Features
| Option | Description |
|---|---|
messages.enableForward | Forward a message to other chats |
messages.enableEdit | Edit a sent message |
messages.enableReply, messages.enableSwipeToReply | Reply to a message, and reply by swiping the message |
messages.enableCopy | Copy the text of a message |
messages.enableStar | Star a message |
messages.enableReactions, messages.reactions | Reactions, and the emoji shown on a long press. An empty list shows no emoji |
messages.enableReplyPrivately | Reply privately to a received group message, in the one-to-one chat with its sender |
messages.enableSenderProfile | In a group chat, a tap on a sender’s name opens the profile popup of the sender |
messages.enableKeep | Keep a disappearing message: the user’s copy no longer disappears, see Sensitive messages |
messages.showMissedCalls | Missed calls in the chat |
voiceMessages.enabled | Voice messages: the microphone button in the message input |
messageAppearance.showBubbleTail | The tail of a message bubble |
messageAppearance.showLargeEmoji | A message of only emoji is shown larger |
messageAppearance.showWallpaperPattern | The faint pattern on the chat background |
messageAppearance.textSize | The text size of messages, see Text size |
messageAppearance.wallpaperPath | A photo as the chat background, see Wallpaper |
Attachments
| Option | Description |
|---|---|
attachments.enabled | The attach button and the camera button in the message input |
attachments.buttonStyle | The attach button: a paper clip (ATTACH_BUTTON_CLIP, default) or a plus (ATTACH_BUTTON_PLUS) |
attachments.buttonImageResource (Android), attachments.buttonImage (iOS) | The app’s own icon for the attach button |
attachments.tiles | The tiles of the attachment sheet |
attachments.showRecentPhotos | Recent photos at the top of the attachment sheet. On iOS, only when the user has given photo access |
The attach button opens the attachment sheet. The sheet has one tile per type of attachment:
gallery, camera, video, document, audio and location. attachments.getTile(type) returns a
built-in tile. The app can change the title, image or color of a tile, disable it, remove it,
reorder the tiles, or add its own tile with a click handler.
// config = MesiboUI.getConfig()
config.attachments.getTile(MesiboUiConfig.Attachment.GALLERY).color = 0xff00868b;
config.attachments.getTile(MesiboUiConfig.Attachment.LOCATION).enabled = false;
config.attachments.tiles.add(new MesiboUiConfig.Attachment("Contact", R.drawable.ic_contact, 0xff009de2,
(activity, profile, attachment) -> shareContact(activity, profile)));
// config = MesiboUI.getConfig()
config.attachments.getTile(MesiboUiConfig.Attachment.GALLERY).color = 0xff00868b.toInt()
config.attachments.getTile(MesiboUiConfig.Attachment.LOCATION).enabled = false
config.attachments.tiles.add(MesiboUiConfig.Attachment("Contact", R.drawable.ic_contact, 0xff009de2.toInt()) {
activity, profile, _ -> shareContact(activity, profile)
})
// config = MesiboUI.getConfig()
config.attachments.getTile(Int32(MESIBO_ATTACH_GALLERY))?.color = 0xff00868b
config.attachments.getTile(Int32(MESIBO_ATTACH_LOCATION))?.enabled = false
let contact = MesiboAttachment(title: "Contact", image: UIImage(systemName: "person.crop.circle"),
color: 0xff009de2) { parent, profile, _ in
self.shareContact(parent, profile: profile)
}
config.attachments.tiles.add(contact)
// config = [MesiboUI getConfig]
[config.attachments getTile:MESIBO_ATTACH_GALLERY].color = 0xff00868b;
[config.attachments getTile:MESIBO_ATTACH_LOCATION].enabled = NO;
[config.attachments.tiles addObject:[[MesiboAttachment alloc] initWithTitle:@"Contact"
image:[UIImage systemImageNamed:@"person.crop.circle"] color:0xff009de2
handler:^(UIViewController *parent, MesiboProfile *profile, MesiboAttachment *attachment) {
[self shareContact:parent profile:profile];
}]];
A click handler set on a built-in tile (listener on Android, handler on iOS) replaces the
tile’s own action. Disabling the Camera tile also hides the camera button of the message input.
To show the app’s own attachment screen instead of the sheet, the app returns false for
ACTION_ATTACHMENTS from MesiboUI_onAction.
Media picker and photo editor
mediaPicker sets how photos, videos and files are picked. imageEditor sets the photo editor,
which opens before a photo is sent. Both apply each time the picker or the editor opens.
| Option | Description |
|---|---|
mediaPicker.useBuiltInGallery | true (default): mesibo’s gallery. false: the system photo picker |
mediaPicker.openGalleryFullScreen | The gallery opens full screen instead of as a sheet |
mediaPicker.galleryButtonAction | The floating button of the gallery: the camera (default), more apps, the album list, or none |
mediaPicker.useBuiltInCamera | true (default): mesibo’s camera. false: the system camera app |
imageEditor.enableLooks, .enableCrop, .enableCanvas, .enableText, .enableStickers, .enableDraw | The tools of the editor |
imageEditor.stickers | The app’s own image stickers |
imageEditor.cropRatios | The crop ratio buttons, as "width:height". Default: 1:1, 4:3, 3:2, 16:9 |
imageEditor.cropFreeTitle | The title of the free crop button |
imageSending.sharpenOnResize | Sharpen a photo after it is scaled down to the size sent |
Picture size
The send screen has a button to choose the size of the picture, for example Standard or HD.
The choice applies to that picture only. The next picture starts again at
imageSending.maxDimension.
The editor works on the largest size, so a crop keeps the most detail. The picture is scaled to the chosen size when it is sent.
| Option | Description |
|---|---|
imageSending.sizes | The sizes, a list of MesiboUiOption: the longest side in pixels, and its title. Default: 1600 Standard, 4096 HD |
imageSending.maxDimension | The size selected when the send screen opens. A value not in sizes selects the first size |
With fewer than two sizes, the button is not shown and pictures are sent at
imageSending.maxDimension.
{"imageSending": {"sizes": [{"value": 1280, "title": "Small"},
{"value": 2560, "title": "Standard"},
{"value": 4096, "title": "HD"}],
"maxDimension": 2560}}
Message options
The message options button is in the message input, next to the camera button. The same button is in the caption field of the photo editor. It opens a sheet with these options:
| Option | Description |
|---|---|
| Disappear after | The message is deleted after this time. Default choices: Never, 1 hour, 24 hours, 7 days, 90 days |
| Timer starts | When that time starts: when the message is sent, delivered or read. Shown once a time is chosen |
| Expires if not delivered in | A message not delivered within this time is dropped. Default choices: Default, Now (15 seconds), 1 hour, 24 hours, 7 days |
| Sensitivity | The sensitivity of the message: Off, Private, Sensitive, Confidential, see Sensitive messages |
| For all messages in this chat | On: the options apply to every message until the chat is closed. Off: to the next message only |
| Clear | Selects the first choice of each option |
A tap on a choice applies it. Done, a tap outside the sheet or a swipe down closes the sheet. The button is highlighted while any option is not at its first choice.
The options replace the chat’s own defaults, for example the disappearing time of the chat. An edited message keeps its options.
| Option | Description |
|---|---|
messageOptions.enabled | The button (default on) |
messageOptions.buttonImageResource (Android), messageOptions.buttonImage (iOS) | The app’s own icon for the button |
messageOptions.ages | The choices of Disappear after, in seconds |
messageOptions.timerStarts | The choices of Timer starts. Empty: the timer always starts when the message is sent |
messageOptions.expiries | The choices of Expires if not delivered in, in seconds |
messageOptions.sensitivities | The sensitivity levels. detail is the line shown under the option for the selected level |
messageOptions.title, .ageTitle, .timerStartTitle, .expiryTitle, .sensitivityTitle, .keepTitle, .clearTitle, .doneTitle | The texts of the sheet |
Each option is a list of MesiboUiOption. The first choice is selected by default. A value of 0
leaves the option unset on the message, so the chat’s default applies. A choice without a title
gets one made from its value, for example 3 days. An empty list hides the option.
The following sets Disappear after to 5 minutes or 1 day, and hides Expires if not delivered in:
// config = MesiboUI.getConfig()
config.messageOptions.ages = new MesiboUiOption[]{
new MesiboUiOption(0, "Never"),
new MesiboUiOption(300, "5 minutes"),
new MesiboUiOption(86400, "1 day")};
config.messageOptions.expiries = new MesiboUiOption[0];
// config = MesiboUI.getConfig()
config.messageOptions.ages = arrayOf(
MesiboUiOption(0, "Never"),
MesiboUiOption(300, "5 minutes"),
MesiboUiOption(86400, "1 day"))
config.messageOptions.expiries = arrayOf()
// config = MesiboUI.getConfig()
config.messageOptions.ages = [
MesiboUiOption(0, title: "Never"),
MesiboUiOption(300, title: "5 minutes"),
MesiboUiOption(86400, title: "1 day")]
config.messageOptions.expiries = []
// config = [MesiboUI getConfig]
config.messageOptions.ages = @[[MesiboUiOption option:0 title:@"Never"],
[MesiboUiOption option:300 title:@"5 minutes"],
[MesiboUiOption option:86400 title:@"1 day"]];
config.messageOptions.expiries = @[];
{"messageOptions": {"ages": [{"value": 0, "title": "Never"},
{"value": 300, "title": "5 minutes"},
{"value": 86400, "title": "1 day"}],
"expiries": []}}
Disappearing messages
A disappearing message has a timer icon by its time. A tap on a disappearing text message shows the time left, for example Disappears in 3h, in place of the time for a moment.
| Option | Description |
|---|---|
messageStatus.showTimerIcon | The timer icon (default on) |
messageStatus.disappearsInTitle | The text shown on a tap. %s (%@ on iOS) is the time left. Default: Disappears in %s |
messageStatus.timerImageResource (Android), messageStatus.timerImage (iOS) | The app’s own timer icon |
MesiboUI.launchDisappearingMessages opens the screen where the user sets the disappearing time of
a chat. The disappearing group sets that screen: disappearing.durations is the list of times and
their titles.
Message status
messageStatus sets the icons by the time of a message: the status of a sent message, the star,
the sensitive icon and the timer. It also has the texts under a message that could not be sent, for
example failedTitle. A tap on such a message sends it again.
Each icon has a color and a picture. A picture set by the app replaces the built-in one: a
drawable resource on Android (the name ends in Resource), a UIImage on iOS.
| Icon | Color | Default color | Picture |
|---|---|---|---|
| Pending (clock) | pendingColor | theme.metaColor | pendingImage |
| Sent (one tick) | sentColor | theme.metaColor | sentImage |
| Delivered (two ticks) | deliveredColor | theme.metaColor | deliveredImage |
| Read (two ticks) | readColor | #FF53BDEB | readImage |
| Failed | failedColor | theme.errorColor | failedImage |
| Star | starColor | theme.metaColor | starImage |
| Sensitive (eye) | sensitiveColor | #FFD9534F | sensitivity.image |
| Disappearing (timer) | timerColor | theme.metaColor | timerImage |
On a picture without a caption, the icons use theme.onMediaColor. The read, failed and sensitive
icons keep their own colors.
{"messageStatus": {"readColor": "#FF34B7F1", "sensitiveColor": "#FFE53935"}}
Message info
When the user selects one sent message, Message info in the selection bar opens the message info screen. The screen shows the message, and when it was delivered and read:
- One-to-one chat: a Read row and a Delivered row, with their times.
- Group chat: every member with their time, in three sections: Read by, Delivered to (delivered but not read) and Not delivered yet.
The screen updates as delivery and read receipts arrive.
| Option | Description |
|---|---|
messageInfo.enabled | Message info in the selection bar (default on) |
messageInfo.title | The action and the screen title. Default: Message info |
messageInfo.readByTitle, .deliveredToTitle, .notDeliveredTitle | The sections for a group message |
messageInfo.readTitle, .deliveredTitle | The rows for a one-to-one message |
The times come from MesiboMessage.getReadTimestamp() and getDeliveryTimestamp(). The app can use
them in its own screens.
Photo and video viewer
The viewer opens a photo or video from a chat, from the media of a profile, or from the media screen. The top shows the sender (You, or the sender’s name) and the time. For today, only the time is shown; otherwise the date and time.
The actions are on the right. Actions that do not fit are in the More menu.
| Action | Description |
|---|---|
| Share | Opens the system share sheet |
| Save | Saves to Photos on iOS, or to Pictures or Movies on Android |
| Forward | Forwards to other chats. Hidden when messages.enableForward is off |
| Delete | Deletes for the user, or for everyone when allowed. The item is also removed from the chat and the media screens |
| Option | Description |
|---|---|
mediaViewer.enableShare, .enableSave, .enableForward, .enableDelete | The actions (default: all on) |
mediaViewer.shareTitle, .saveTitle, .forwardTitle, .deleteTitle | The names of the actions, in the menu and for accessibility |
mediaViewer.savedTitle, .saveFailedTitle | Shown after saving, and when saving failed |
For a sensitive message, Save and Share are shown, but at
sensitivity.blockCopyLevel a tap shows sensitivity.blockedCopyMessage. Forward is the same at
sensitivity.blockForwardLevel, with sensitivity.blockedForwardMessage.
On iOS, Save needs NSPhotoLibraryAddUsageDescription in the app’s Info.plist. On Android 9 and
earlier, Save needs the storage permission.