diff --git a/assets/l10n/intl_en.arb b/assets/l10n/intl_en.arb index 81aa0976..480fc0ee 100644 --- a/assets/l10n/intl_en.arb +++ b/assets/l10n/intl_en.arb @@ -2729,5 +2729,6 @@ "placeCall": "Place call", "voiceCall": "Voice call", "unsupportedAndroidVersion": "Unsupported Android version", - "unsupportedAndroidVersionLong": "This feature required a never Android version. Please check for updates or Lineage OS support." + "unsupportedAndroidVersionLong": "This feature required a never Android version. Please check for updates or Lineage OS support.", + "videoCallsBetaWarning": "Please note that video calls are currently in beta. They might not work as expected or work at all on all platforms." } diff --git a/lib/pages/chat/chat.dart b/lib/pages/chat/chat.dart index 3fcd29ba..64067ea0 100644 --- a/lib/pages/chat/chat.dart +++ b/lib/pages/chat/chat.dart @@ -8,7 +8,6 @@ import 'package:flutter/scheduler.dart'; import 'package:flutter/services.dart'; import 'package:adaptive_dialog/adaptive_dialog.dart'; -import 'package:animations/animations.dart'; import 'package:desktop_drop/desktop_drop.dart'; import 'package:device_info_plus/device_info_plus.dart'; import 'package:emoji_picker_flutter/emoji_picker_flutter.dart'; @@ -959,56 +958,34 @@ class ChatController extends State { DeviceInfoPlugin().androidInfo.then((value) { if ((value.version.sdkInt ?? 16) < 21) { Navigator.pop(context); - showModal( + showOkAlertDialog( context: context, - builder: (context) => AlertDialog( - title: Text(L10n.of(context)!.unsupportedAndroidVersion), - content: Text(L10n.of(context)!.unsupportedAndroidVersionLong), - actions: [ - TextButton( - onPressed: Navigator.of(context).pop, - child: Text(L10n.of(context)!.ok)) - ], - ), + title: L10n.of(context)!.unsupportedAndroidVersion, + message: L10n.of(context)!.unsupportedAndroidVersionLong, + okLabel: L10n.of(context)!.close, ); } }); } - final callType = await showDialog( - context: context, - builder: (BuildContext context) { - return SimpleDialog( - title: Text(L10n.of(context)!.placeCall), - children: [ - ListTile( - leading: const Icon(Icons.phone), - title: Text(L10n.of(context)!.voiceCall), - onTap: () { - Navigator.pop(context, CallType.kVoice); - }, - ), - ListTile( - leading: const Icon(Icons.videocam), - title: Text(L10n.of(context)!.videoCall), - onTap: () { - Navigator.pop(context, CallType.kVideo); - }, - ), - ListTile( - leading: const Icon(Icons.cancel), - title: Text(L10n.of(context)!.cancel), - onTap: () { - Navigator.pop(context, null); - }, - ), - ], - ); - }, - useRootNavigator: false); + final callType = await showModalActionSheet( + context: context, + title: L10n.of(context)!.videoCallsBetaWarning, + cancelLabel: L10n.of(context)!.cancel, + actions: [ + SheetAction( + label: L10n.of(context)!.voiceCall, + icon: Icons.phone_outlined, + key: CallType.kVoice, + ), + SheetAction( + label: L10n.of(context)!.videoCall, + icon: Icons.video_call_outlined, + key: CallType.kVideo, + ), + ], + ); + if (callType == null) return; - if (callType == null) { - return; - } final success = await showFutureLoadingDialog( context: context, future: () => diff --git a/lib/pages/chat/chat_view.dart b/lib/pages/chat/chat_view.dart index c4f07bc3..10d61279 100644 --- a/lib/pages/chat/chat_view.dart +++ b/lib/pages/chat/chat_view.dart @@ -122,7 +122,7 @@ class ChatView extends StatelessWidget { ), IconButton( onPressed: controller.onPhoneButtonTap, - icon: const Icon(Icons.phone), + icon: const Icon(Icons.call_outlined), tooltip: L10n.of(context)!.placeCall, ), EncryptionButton(controller.room!),