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

OptionDescription
messages.enableForwardForward a message to other chats
messages.enableEditEdit a sent message
messages.enableReply, messages.enableSwipeToReplyReply to a message, and reply by swiping the message
messages.enableCopyCopy the text of a message
messages.enableStarStar a message
messages.enableReactions, messages.reactionsReactions, and the emoji shown on a long press. An empty list shows no emoji
messages.enableReplyPrivatelyReply privately to a received group message, in the one-to-one chat with its sender
messages.enableSenderProfileIn a group chat, a tap on a sender’s name opens the profile popup of the sender
messages.enableKeepKeep a disappearing message: the user’s copy no longer disappears, see Sensitive messages
messages.showMissedCallsMissed calls in the chat
voiceMessages.enabledVoice messages: the microphone button in the message input
messageAppearance.showBubbleTailThe tail of a message bubble
messageAppearance.showLargeEmojiA message of only emoji is shown larger
messageAppearance.showWallpaperPatternThe faint pattern on the chat background
messageAppearance.textSizeThe text size of messages, see Text size
messageAppearance.wallpaperPathA photo as the chat background, see Wallpaper

Attachments

OptionDescription
attachments.enabledThe attach button and the camera button in the message input
attachments.buttonStyleThe 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.tilesThe tiles of the attachment sheet
attachments.showRecentPhotosRecent 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.

OptionDescription
mediaPicker.useBuiltInGallerytrue (default): mesibo’s gallery. false: the system photo picker
mediaPicker.openGalleryFullScreenThe gallery opens full screen instead of as a sheet
mediaPicker.galleryButtonActionThe floating button of the gallery: the camera (default), more apps, the album list, or none
mediaPicker.useBuiltInCameratrue (default): mesibo’s camera. false: the system camera app
imageEditor.enableLooks, .enableCrop, .enableCanvas, .enableText, .enableStickers, .enableDrawThe tools of the editor
imageEditor.stickersThe app’s own image stickers
imageEditor.cropRatiosThe crop ratio buttons, as "width:height". Default: 1:1, 4:3, 3:2, 16:9
imageEditor.cropFreeTitleThe title of the free crop button
imageSending.sharpenOnResizeSharpen 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.

OptionDescription
imageSending.sizesThe sizes, a list of MesiboUiOption: the longest side in pixels, and its title. Default: 1600 Standard, 4096 HD
imageSending.maxDimensionThe 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:

OptionDescription
Disappear afterThe message is deleted after this time. Default choices: Never, 1 hour, 24 hours, 7 days, 90 days
Timer startsWhen that time starts: when the message is sent, delivered or read. Shown once a time is chosen
Expires if not delivered inA message not delivered within this time is dropped. Default choices: Default, Now (15 seconds), 1 hour, 24 hours, 7 days
SensitivityThe sensitivity of the message: Off, Private, Sensitive, Confidential, see Sensitive messages
For all messages in this chatOn: the options apply to every message until the chat is closed. Off: to the next message only
ClearSelects 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.

OptionDescription
messageOptions.enabledThe button (default on)
messageOptions.buttonImageResource (Android), messageOptions.buttonImage (iOS)The app’s own icon for the button
messageOptions.agesThe choices of Disappear after, in seconds
messageOptions.timerStartsThe choices of Timer starts. Empty: the timer always starts when the message is sent
messageOptions.expiriesThe choices of Expires if not delivered in, in seconds
messageOptions.sensitivitiesThe sensitivity levels. detail is the line shown under the option for the selected level
messageOptions.title, .ageTitle, .timerStartTitle, .expiryTitle, .sensitivityTitle, .keepTitle, .clearTitle, .doneTitleThe 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.

OptionDescription
messageStatus.showTimerIconThe timer icon (default on)
messageStatus.disappearsInTitleThe 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.

IconColorDefault colorPicture
Pending (clock)pendingColortheme.metaColorpendingImage
Sent (one tick)sentColortheme.metaColorsentImage
Delivered (two ticks)deliveredColortheme.metaColordeliveredImage
Read (two ticks)readColor#FF53BDEBreadImage
FailedfailedColortheme.errorColorfailedImage
StarstarColortheme.metaColorstarImage
Sensitive (eye)sensitiveColor#FFD9534Fsensitivity.image
Disappearing (timer)timerColortheme.metaColortimerImage

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.

OptionDescription
messageInfo.enabledMessage info in the selection bar (default on)
messageInfo.titleThe action and the screen title. Default: Message info
messageInfo.readByTitle, .deliveredToTitle, .notDeliveredTitleThe sections for a group message
messageInfo.readTitle, .deliveredTitleThe 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.

ActionDescription
ShareOpens the system share sheet
SaveSaves to Photos on iOS, or to Pictures or Movies on Android
ForwardForwards to other chats. Hidden when messages.enableForward is off
DeleteDeletes for the user, or for everyone when allowed. The item is also removed from the chat and the media screens
OptionDescription
mediaViewer.enableShare, .enableSave, .enableForward, .enableDeleteThe actions (default: all on)
mediaViewer.shareTitle, .saveTitle, .forwardTitle, .deleteTitleThe names of the actions, in the menu and for accessibility
mediaViewer.savedTitle, .saveFailedTitleShown 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.