Enhanced UX and clean up
This commit is contained in:
parent
7b2f4c0163
commit
e665f4adc3
6 changed files with 41 additions and 89 deletions
|
|
@ -5,7 +5,7 @@ import 'package:famedlysdk/famedlysdk.dart';
|
|||
import 'package:file_picker/file_picker.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/chat_settings_popup_menu.dart';
|
||||
import 'package:fluffychat/components/dialogs/confirm_dialog.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/list_items/message.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/components/reply_content.dart';
|
||||
|
|
@ -234,13 +234,9 @@ class _ChatState extends State<_Chat> {
|
|||
}
|
||||
|
||||
void redactEventsAction(BuildContext context) async {
|
||||
bool confirmed = false;
|
||||
await showDialog(
|
||||
context: context,
|
||||
builder: (context) => ConfirmDialog(
|
||||
I18n.of(context).messageWillBeRemovedWarning,
|
||||
I18n.of(context).remove,
|
||||
(c) => confirmed = true),
|
||||
bool confirmed = await SimpleDialogs(context).askConfirmation(
|
||||
titleText: I18n.of(context).messageWillBeRemovedWarning,
|
||||
confirmText: I18n.of(context).remove,
|
||||
);
|
||||
if (!confirmed) return;
|
||||
for (Event event in selectedEvents) {
|
||||
|
|
@ -280,6 +276,7 @@ class _ChatState extends State<_Chat> {
|
|||
replyEvent = selectedEvents.first;
|
||||
selectedEvents.clear();
|
||||
});
|
||||
inputFocus.requestFocus();
|
||||
}
|
||||
|
||||
@override
|
||||
|
|
@ -400,28 +397,7 @@ class _ChatState extends State<_Chat> {
|
|||
SafeArea(
|
||||
child: Column(
|
||||
children: <Widget>[
|
||||
Material(
|
||||
elevation: 1,
|
||||
color: Theme.of(context).scaffoldBackgroundColor,
|
||||
child: AnimatedContainer(
|
||||
duration: Duration(milliseconds: 300),
|
||||
height: _loadingHistory ? 40 : 0,
|
||||
child: Center(
|
||||
child: Row(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
children: <Widget>[
|
||||
Container(
|
||||
height: 20,
|
||||
width: 20,
|
||||
child: CircularProgressIndicator(strokeWidth: 2),
|
||||
),
|
||||
SizedBox(width: 8),
|
||||
Text(I18n.of(context).loadingPleaseWait),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
if (_loadingHistory) LinearProgressIndicator(),
|
||||
Expanded(
|
||||
child: FutureBuilder<bool>(
|
||||
future: getTimeline(),
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ class _ChatDetailsState extends State<ChatDetails> {
|
|||
labelText: I18n.of(context).setInvitationLink,
|
||||
hintText: I18n.of(context).alias.toLowerCase(),
|
||||
prefixText: "#",
|
||||
suffixText: widget.room.client.userID.domain,
|
||||
suffixText: ":" + widget.room.client.userID.domain,
|
||||
);
|
||||
if (s == null) return;
|
||||
final String domain = widget.room.client.userID.domain;
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import 'dart:async';
|
|||
|
||||
import 'package:famedlysdk/famedlysdk.dart';
|
||||
import 'package:fluffychat/components/adaptive_page_layout.dart';
|
||||
import 'package:fluffychat/components/dialogs/confirm_dialog.dart';
|
||||
import 'package:fluffychat/components/dialogs/simple_dialogs.dart';
|
||||
import 'package:fluffychat/components/matrix.dart';
|
||||
import 'package:fluffychat/utils/beautify_string_extension.dart';
|
||||
import 'package:fluffychat/i18n/i18n.dart';
|
||||
|
|
@ -62,23 +62,21 @@ class _ChatEncryptionSettingsState extends State<ChatEncryptionSettings> {
|
|||
subtitle: Text(room.encryptionAlgorithm ?? I18n.of(context).none),
|
||||
trailing: Icon(room.encrypted ? Icons.lock : Icons.lock_open,
|
||||
color: room.encrypted ? Colors.green : Colors.red),
|
||||
onTap: () {
|
||||
onTap: () async {
|
||||
if (room.encrypted) return;
|
||||
if (!room.client.encryptionEnabled) {
|
||||
Toast.show(I18n.of(context).needPantalaimonWarning, context,
|
||||
duration: 8);
|
||||
return;
|
||||
}
|
||||
showDialog(
|
||||
context: context,
|
||||
builder: (BuildContext context) => ConfirmDialog(
|
||||
I18n.of(context).enableEncryptionWarning,
|
||||
I18n.of(context).yes,
|
||||
(context) => Matrix.of(context).tryRequestWithLoadingDialog(
|
||||
room.enableEncryption(),
|
||||
),
|
||||
),
|
||||
);
|
||||
if (await SimpleDialogs(context).askConfirmation(
|
||||
titleText: I18n.of(context).enableEncryptionWarning,
|
||||
confirmText: I18n.of(context).yes) ==
|
||||
true) {
|
||||
await Matrix.of(context).tryRequestWithLoadingDialog(
|
||||
room.enableEncryption(),
|
||||
);
|
||||
}
|
||||
},
|
||||
),
|
||||
ListTile(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue