chore: Better call UX sounds and timeline design
This commit is contained in:
parent
87c534faf2
commit
c0244c66ab
9 changed files with 50 additions and 45 deletions
|
|
@ -990,9 +990,7 @@ class ChatController extends State<Chat> {
|
|||
final voipPlugin = Matrix.of(context).voipPlugin;
|
||||
await voipPlugin!.voip.inviteToCall(room!.id, callType).catchError((e) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text(e.toString())
|
||||
// Text(LocalizedExceptionExtension(context, e)),
|
||||
),
|
||||
SnackBar(content: Text((e as Object).toLocalizedString(context))),
|
||||
);
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -45,8 +45,15 @@ class Message extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (![EventTypes.Message, EventTypes.Sticker, EventTypes.Encrypted]
|
||||
.contains(event.type)) {
|
||||
if (!{
|
||||
EventTypes.Message,
|
||||
EventTypes.Sticker,
|
||||
EventTypes.Encrypted,
|
||||
EventTypes.CallInvite
|
||||
}.contains(event.type)) {
|
||||
if (event.type.startsWith('m.call.')) {
|
||||
return Container();
|
||||
}
|
||||
return StateMessage(event, unfold: unfold);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,6 +199,13 @@ class MessageContent extends StatelessWidget {
|
|||
onLinkTap: (url) => UrlLauncher(context, url).launchUrl(),
|
||||
);
|
||||
}
|
||||
case EventTypes.CallInvite:
|
||||
return _ButtonContent(
|
||||
label: L10n.of(context)!.startedACall(event.sender.calcDisplayname()),
|
||||
icon: const Icon(Icons.phone_outlined),
|
||||
textColor: buttonTextColor,
|
||||
onPressed: () => onInfoTab!(event),
|
||||
);
|
||||
default:
|
||||
return _ButtonContent(
|
||||
label: L10n.of(context)!
|
||||
|
|
@ -227,11 +234,14 @@ class _ButtonContent extends StatelessWidget {
|
|||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return TextButton.icon(
|
||||
return OutlinedButton.icon(
|
||||
onPressed: onPressed,
|
||||
icon: icon,
|
||||
label: Text(label, overflow: TextOverflow.ellipsis),
|
||||
style: TextButton.styleFrom(primary: textColor),
|
||||
style: OutlinedButton.styleFrom(
|
||||
primary: textColor,
|
||||
backgroundColor: Colors.white.withAlpha(64),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue