Dialogs
MesiboDialogs shows the same alerts and bottom sheets as the messaging UI. The app can use it for
its own dialogs, so that they look the same. MesiboDialogs.Options (MesiboDialogOptions on iOS)
sets the content:
| Option | Description |
|---|---|
title, message | The title and the text |
positiveLabel, onPositive | The positive button and its handler. No label: common.okTitle |
negativeLabel, onNegative | The negative button and its handler. No label: no negative button |
destructive | The positive button in red |
sheet | A bottom sheet instead of a centered dialog |
items, onSelect | A list of choices instead of a message. onSelect gets the index of the tapped item |
destructiveItems | The indexes of items shown in red |
MesiboDialogs.Options o = new MesiboDialogs.Options();
o.title = "Delete chats?";
o.positiveLabel = "Delete";
o.negativeLabel = MesiboUI.getConfig().common.cancelTitle;
o.destructive = true;
o.onPositive = () -> deleteChats();
MesiboDialogs.show(context, o);
MesiboDialogs.alert(context, "Signed Out", "Login again to continue.");
val o = MesiboDialogs.Options()
o.title = "Delete chats?"
o.positiveLabel = "Delete"
o.negativeLabel = MesiboUI.getConfig().common.cancelTitle
o.destructive = true
o.onPositive = Runnable { deleteChats() }
MesiboDialogs.show(context, o)
MesiboDialogs.alert(context, "Signed Out", "Login again to continue.")
let o = MesiboDialogOptions()
o.title = "Delete chats?"
o.positiveLabel = "Delete"
o.negativeLabel = MesiboUI.getConfig().common.cancelTitle
o.destructive = true
o.onPositive = { self.deleteChats() }
MesiboDialogs.show(self, options: o)
MesiboDialogs.alert(self, title: "Signed Out", message: "Login again to continue.")
MesiboDialogOptions *o = [MesiboDialogOptions new];
o.title = @"Delete chats?";
o.positiveLabel = @"Delete";
o.negativeLabel = [MesiboUI getConfig].common.cancelTitle;
o.destructive = YES;
o.onPositive = ^{ [self deleteChats]; };
[MesiboDialogs show:self options:o];
[MesiboDialogs alert:self title:@"Signed Out" message:@"Login again to continue."];