mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-05-01 13:46:57 +02:00
VoIP: Show an action sheet when the user clicks on the call button. He will be able to select Voice or Video Call
This commit is contained in:
@@ -25,6 +25,9 @@
|
||||
@interface RoomInputToolbarView()
|
||||
{
|
||||
MediaPickerViewController *mediaPicker;
|
||||
|
||||
// The call type selection (voice or video)
|
||||
MXKAlert *callActionSheet;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -186,7 +189,33 @@
|
||||
{
|
||||
if ([self.delegate respondsToSelector:@selector(roomInputToolbarView:placeCallWithVideo:)])
|
||||
{
|
||||
[self.delegate roomInputToolbarView:self placeCallWithVideo:NO];
|
||||
// Ask the user the kind of the call: voice or video?
|
||||
callActionSheet = [[MXKAlert alloc] initWithTitle:nil message:nil style:MXKAlertStyleActionSheet];
|
||||
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[callActionSheet addActionWithTitle:NSLocalizedStringFromTable(@"voice", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->callActionSheet = nil;
|
||||
|
||||
[strongSelf.delegate roomInputToolbarView:strongSelf placeCallWithVideo:NO];
|
||||
}];
|
||||
|
||||
[callActionSheet addActionWithTitle:NSLocalizedStringFromTable(@"video", @"Vector", nil) style:MXKAlertActionStyleDefault handler:^(MXKAlert *alert) {
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->callActionSheet = nil;
|
||||
|
||||
[strongSelf.delegate roomInputToolbarView:strongSelf placeCallWithVideo:YES];
|
||||
}];
|
||||
|
||||
callActionSheet.cancelButtonIndex = [callActionSheet addActionWithTitle:[NSBundle mxk_localizedStringForKey:@"cancel"] style:MXKAlertActionStyleCancel handler:^(MXKAlert *alert) {
|
||||
|
||||
__strong __typeof(weakSelf)strongSelf = weakSelf;
|
||||
strongSelf->callActionSheet = nil;
|
||||
}];
|
||||
|
||||
callActionSheet.sourceView = self.voiceCallButton;
|
||||
|
||||
[callActionSheet showInViewController:self.window.rootViewController];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +226,12 @@
|
||||
- (void)destroy
|
||||
{
|
||||
[self dismissMediaPicker];
|
||||
|
||||
if (callActionSheet)
|
||||
{
|
||||
[callActionSheet dismiss:NO];
|
||||
callActionSheet = nil;
|
||||
}
|
||||
|
||||
[super destroy];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user