Commit 3619bcea authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Kateryna Kostiuk

fix: use alert for iPad instead of actionsheet

- uses an alert type uialertcontroller instead of an actionsheet,
  as actionsheet behaviour on the iPad is undesired. On both device
  types, an incoming call alert will be modal for now.

Change-Id: I836a51fb46503e03d7151449c7cd11fdd85f83fd
Reviewed-by: Kateryna Kostiuk's avatarKateryna Kostiuk <kateryna.kostiuk@savoirfairelinux.com>
parent 8d0cf1dd
......@@ -95,7 +95,8 @@ class ConversationsCoordinator: Coordinator, StateableResponsive {
}
private func showCallAlert(call: CallModel) {
let alert = UIAlertController(title: L10n.Alerts.incomingCallAllertTitle + "\(call.displayName)", message: nil, preferredStyle: UIAlertControllerStyle.actionSheet)
let alertStyle = (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiom.pad) ? UIAlertControllerStyle.alert : UIAlertControllerStyle.actionSheet
let alert = UIAlertController(title: L10n.Alerts.incomingCallAllertTitle + "\(call.displayName)", message: nil, preferredStyle: alertStyle)
alert.addAction(UIAlertAction(title: L10n.Alerts.incomingCallButtonAccept, style: UIAlertActionStyle.default, handler: { (_) in
self.answerIncomingCall(call: call)
alert.dismiss(animated: true, completion: nil)}))
......@@ -108,7 +109,7 @@ class ConversationsCoordinator: Coordinator, StateableResponsive {
}))
if let controller = self.rootViewController.presentedViewController {
controller.present(alert, animated: false, completion: nil)
controller.present(alert, animated: false, completion: nil)
} else {
self.present(viewController: alert, withStyle: .present, withAnimation: true)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment