Skip to content

Commit

Permalink
modify setting ui of 'burn after reading'.
Browse files Browse the repository at this point in the history
  • Loading branch information
chenakam committed Aug 14, 2020
1 parent 23e54cb commit 7ea0426
Show file tree
Hide file tree
Showing 9 changed files with 193 additions and 221 deletions.
24 changes: 18 additions & 6 deletions l10n-arb/intl_messages.arb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"@@last_modified": "2020-08-12T13:37:04.844098",
"@@last_modified": "2020-08-13T19:21:54.922077",
"nkn": "NKN",
"@nkn": {
"description": "",
Expand Down Expand Up @@ -1358,6 +1358,18 @@
"type": "text",
"placeholders": {}
},
"burn_6_hour": "6 hours",
"@burn_6_hour": {
"description": "",
"type": "text",
"placeholders": {}
},
"burn_12_hour": "12 hours",
"@burn_12_hour": {
"description": "",
"type": "text",
"placeholders": {}
},
"burn_1_day": "1 day",
"@burn_1_day": {
"description": "",
Expand Down Expand Up @@ -1584,11 +1596,6 @@
"type": "text",
"placeholders": {}
},
"disappear_desc": "Messages received and sent will disappear after the set time.",
"@disappear_desc": {
"type": "text",
"placeholders": {}
},
"account_switching_completed": "Account switching Completed",
"@account_switching_completed": {
"type": "text",
Expand Down Expand Up @@ -1645,6 +1652,11 @@
"type": "text",
"placeholders": {}
},
"click_to_change": "Click to change",
"@click_to_change": {
"type": "text",
"placeholders": {}
},
"top": "top",
"@top": {
"type": "text",
Expand Down
22 changes: 17 additions & 5 deletions l10n-arb/intl_zh.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1334,6 +1334,18 @@
"type": "text",
"placeholders": {}
},
"burn_6_hour": "6 小时",
"@burn_6_hour": {
"description": "",
"type": "text",
"placeholders": {}
},
"burn_12_hour": "12 小时",
"@burn_12_hour": {
"description": "",
"type": "text",
"placeholders": {}
},
"burn_1_day": "1 天",
"@burn_1_day": {
"description": "",
Expand Down Expand Up @@ -1560,11 +1572,6 @@
"type": "text",
"placeholders": {}
},
"disappear_desc": "接受和发送的消息将在设定的时间后消失。",
"@disappear_desc": {
"type": "text",
"placeholders": {}
},
"account_switching_completed": "已完成账号切换",
"@account_switching_completed": {
"type": "text",
Expand Down Expand Up @@ -1621,6 +1628,11 @@
"type": "text",
"placeholders": {}
},
"click_to_change": "点击更改",
"@click_to_change": {
"type": "text",
"placeholders": {}
},
"top": "置顶",
"@top": {
"type": "text",
Expand Down
10 changes: 9 additions & 1 deletion lib/l10n/localization_intl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -922,6 +922,14 @@ class NL10ns {
return Intl.message('1 hour', name: 'burn_1_hour', desc: '');
}

String get burn_6_hour {
return Intl.message('6 hours', name: 'burn_6_hour', desc: '');
}

String get burn_12_hour {
return Intl.message('12 hours', name: 'burn_12_hour', desc: '');
}

String get burn_1_day {
return Intl.message('1 day', name: 'burn_1_day', desc: '');
}
Expand Down Expand Up @@ -1042,7 +1050,6 @@ class NL10ns {
String get profile => Intl.message('Profile', name: 'profile');
String get send_message => Intl.message('Send Message', name: 'send_message');
String get show_wallet_address_desc => Intl.message('Scan the QR code, you can transfer it to me', name: 'show_wallet_address_desc');
String get disappear_desc => Intl.message('Messages received and sent will disappear after the set time.', name: 'disappear_desc');

String get account_switching_completed => Intl.message('Account switching Completed', name: 'account_switching_completed');
String get storage_text => Intl.message('Storage', name: 'storage_text');
Expand All @@ -1057,6 +1064,7 @@ class NL10ns {
String get weeks => Intl.message('weeks', name: 'weeks');

String get select => Intl.message('Select', name: 'select');
String get click_to_change => Intl.message('Click to change', name: 'click_to_change');
String get top => Intl.message('top', name: 'top');

String burn_after_reading_desc_disappear(String time) {
Expand Down
4 changes: 3 additions & 1 deletion lib/l10n/messages_messages.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class MessageLookup extends MessageLookupByLibrary {
"average" : MessageLookupByLibrary.simpleMessage("Average"),
"burn_10_minutes" : MessageLookupByLibrary.simpleMessage("10 minutes"),
"burn_10_seconds" : MessageLookupByLibrary.simpleMessage("10 seconds"),
"burn_12_hour" : MessageLookupByLibrary.simpleMessage("12 hours"),
"burn_1_day" : MessageLookupByLibrary.simpleMessage("1 day"),
"burn_1_hour" : MessageLookupByLibrary.simpleMessage("1 hour"),
"burn_1_minute" : MessageLookupByLibrary.simpleMessage("1 minute"),
Expand All @@ -50,6 +51,7 @@ class MessageLookup extends MessageLookupByLibrary {
"burn_30_seconds" : MessageLookupByLibrary.simpleMessage("30 seconds"),
"burn_5_minutes" : MessageLookupByLibrary.simpleMessage("5 minutes"),
"burn_5_seconds" : MessageLookupByLibrary.simpleMessage("5 seconds"),
"burn_6_hour" : MessageLookupByLibrary.simpleMessage("6 hours"),
"burn_after_reading" : MessageLookupByLibrary.simpleMessage("Burn After Reading"),
"burn_after_reading_desc" : MessageLookupByLibrary.simpleMessage("Your messages will not expire."),
"burn_after_reading_desc_disappear" : m0,
Expand All @@ -71,6 +73,7 @@ class MessageLookup extends MessageLookupByLibrary {
"clear_cache" : MessageLookupByLibrary.simpleMessage("Clear Cache"),
"clear_database" : MessageLookupByLibrary.simpleMessage("Clear Database"),
"click_connect" : MessageLookupByLibrary.simpleMessage("Click this button for connect"),
"click_to_change" : MessageLookupByLibrary.simpleMessage("Click to change"),
"click_to_settings" : MessageLookupByLibrary.simpleMessage("Click to settings"),
"client_address" : MessageLookupByLibrary.simpleMessage("Client Address"),
"close" : MessageLookupByLibrary.simpleMessage("Close"),
Expand Down Expand Up @@ -111,7 +114,6 @@ class MessageLookup extends MessageLookupByLibrary {
"delete_wallet" : MessageLookupByLibrary.simpleMessage("Delete Wallet"),
"delete_wallet_confirm_text" : MessageLookupByLibrary.simpleMessage("This will remove the wallet off your local device. Please make sure your wallet is fully backed up or you will lose your funds."),
"delete_wallet_confirm_title" : MessageLookupByLibrary.simpleMessage("Are you sure you want to delete this wallet?"),
"disappear_desc" : MessageLookupByLibrary.simpleMessage("Messages received and sent will disappear after the set time."),
"done" : MessageLookupByLibrary.simpleMessage("Done"),
"edit" : MessageLookupByLibrary.simpleMessage("Edit"),
"edit_contact" : MessageLookupByLibrary.simpleMessage("Edit Contact"),
Expand Down
4 changes: 3 additions & 1 deletion lib/l10n/messages_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class MessageLookup extends MessageLookupByLibrary {
"average" : MessageLookupByLibrary.simpleMessage("平均"),
"burn_10_minutes" : MessageLookupByLibrary.simpleMessage("10 分钟"),
"burn_10_seconds" : MessageLookupByLibrary.simpleMessage("10 秒"),
"burn_12_hour" : MessageLookupByLibrary.simpleMessage("12 小时"),
"burn_1_day" : MessageLookupByLibrary.simpleMessage("1 天"),
"burn_1_hour" : MessageLookupByLibrary.simpleMessage("1 小时"),
"burn_1_minute" : MessageLookupByLibrary.simpleMessage("1 分钟"),
Expand All @@ -50,6 +51,7 @@ class MessageLookup extends MessageLookupByLibrary {
"burn_30_seconds" : MessageLookupByLibrary.simpleMessage("30 秒"),
"burn_5_minutes" : MessageLookupByLibrary.simpleMessage("5 分钟"),
"burn_5_seconds" : MessageLookupByLibrary.simpleMessage("5 秒"),
"burn_6_hour" : MessageLookupByLibrary.simpleMessage("6 小时"),
"burn_after_reading" : MessageLookupByLibrary.simpleMessage("阅后即焚"),
"burn_after_reading_desc" : MessageLookupByLibrary.simpleMessage("该对话接收和发送的消息不会消失。"),
"burn_after_reading_desc_disappear" : m0,
Expand All @@ -71,6 +73,7 @@ class MessageLookup extends MessageLookupByLibrary {
"clear_cache" : MessageLookupByLibrary.simpleMessage("清除缓存"),
"clear_database" : MessageLookupByLibrary.simpleMessage("清除数据库"),
"click_connect" : MessageLookupByLibrary.simpleMessage("点击连接"),
"click_to_change" : MessageLookupByLibrary.simpleMessage("点击更改"),
"click_to_settings" : MessageLookupByLibrary.simpleMessage("点击设置"),
"client_address" : MessageLookupByLibrary.simpleMessage("地址"),
"close" : MessageLookupByLibrary.simpleMessage("关闭"),
Expand Down Expand Up @@ -111,7 +114,6 @@ class MessageLookup extends MessageLookupByLibrary {
"delete_wallet" : MessageLookupByLibrary.simpleMessage("删除钱包"),
"delete_wallet_confirm_text" : MessageLookupByLibrary.simpleMessage("这将从您的设备中删除钱包。请确保您的钱包已备份,否则您的资金将丢失且无法找回。"),
"delete_wallet_confirm_title" : MessageLookupByLibrary.simpleMessage("您确定要删除此钱包吗?"),
"disappear_desc" : MessageLookupByLibrary.simpleMessage("接受和发送的消息将在设定的时间后消失。"),
"done" : MessageLookupByLibrary.simpleMessage("完成"),
"edit" : MessageLookupByLibrary.simpleMessage("编辑"),
"edit_contact" : MessageLookupByLibrary.simpleMessage("编辑"),
Expand Down
57 changes: 15 additions & 42 deletions lib/screens/chat/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import 'package:nmobile/l10n/localization_intl.dart';
import 'package:nmobile/schemas/chat.dart';
import 'package:nmobile/schemas/message.dart';
import 'package:nmobile/screens/contact/contact.dart';
import 'package:nmobile/screens/view/burn_view_utils.dart';
import 'package:nmobile/utils/extensions.dart';
import 'package:nmobile/utils/image_utils.dart';

Expand Down Expand Up @@ -348,10 +347,7 @@ class _ChatSinglePageState extends State<ChatSinglePage> with AccountDependsBloc
appBar: Header(
titleChild: GestureDetector(
onTap: () async {
Navigator.of(context).pushNamed(
ContactScreen.routeName,
arguments: widget.arguments.contact,
);
Navigator.of(context).pushNamed(ContactScreen.routeName, arguments: widget.arguments.contact);
},
child: Flex(
direction: Axis.horizontal,
Expand Down Expand Up @@ -382,11 +378,8 @@ class _ChatSinglePageState extends State<ChatSinglePage> with AccountDependsBloc
onSelected: (int result) {
switch (result) {
case 0:
// Navigator.of(context).pushNamed(
// ContactScreen.routeName,
// arguments: widget.arguments.contact,
// );
BurnViewUtil.showBurnViewDialog(context, widget.arguments.contact, _chatBloc);
Navigator.of(context).pushNamed(ContactScreen.routeName, arguments: widget.arguments.contact);
// BurnViewUtil.showBurnViewDialog(context, widget.arguments.contact, _chatBloc);
break;
}
},
Expand Down Expand Up @@ -469,25 +462,15 @@ class _ChatSinglePageState extends State<ChatSinglePage> with AccountDependsBloc
),
Label(' ${NL10ns.of(context).update_burn_after_reading}', softWrap: true),
],
).pad(b: 4),
InkWell(
child: Label(NL10ns.of(context).click_to_change, color: DefaultTheme.primaryColor, type: LabelType.bodyRegular),
onTap: () {
Navigator.of(context).pushNamed(ContactScreen.routeName, arguments: widget.arguments.contact);
},
),
],
),
// Padding(
// padding: const EdgeInsets.only(left: 8),
// child: InkWell(
// child: Label(
// NMobileLocalizations.of(context).settings,
// color: DefaultTheme.primaryColor,
// type: LabelType.bodyRegular,
// ),
// onTap: () {
// Navigator.of(context).pushNamed(
// ContactScreen.routeName,
// arguments: widget.arguments.contact,
// );
// },
// ),
// ),
],
),
);
Expand Down Expand Up @@ -517,25 +500,15 @@ class _ChatSinglePageState extends State<ChatSinglePage> with AccountDependsBloc
),
Label(' ${NL10ns.of(context).close_burn_after_reading}'),
],
).pad(b: 4),
InkWell(
child: Label(NL10ns.of(context).click_to_change, color: DefaultTheme.primaryColor, type: LabelType.bodyRegular),
onTap: () {
Navigator.of(context).pushNamed(ContactScreen.routeName, arguments: widget.arguments.contact);
},
),
],
),
// Padding(
// padding: const EdgeInsets.only(left: 8),
// child: InkWell(
// child: Label(
// NMobileLocalizations.of(context).settings,
// color: DefaultTheme.primaryColor,
// type: LabelType.bodyRegular,
// ),
// onTap: () {
// Navigator.of(context).pushNamed(
// ContactScreen.routeName,
// arguments: widget.arguments.contact,
// );
// },
// ),
// ),
],
),
);
Expand Down
Loading

0 comments on commit 7ea0426

Please sign in to comment.