Skip to content

Commit

Permalink
TW-2022: Change explain text in permission dialog
Browse files Browse the repository at this point in the history
  • Loading branch information
nqhhdev committed Sep 13, 2024
1 parent 01527b8 commit 8e1cc5c
Show file tree
Hide file tree
Showing 10 changed files with 41 additions and 31 deletions.
10 changes: 5 additions & 5 deletions assets/l10n/intl_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,7 @@
"type": "text",
"placeholders": {}
},
"loading": "Loading status...",
"loadingStatus": "Loading status...",
"loadMore": "Load more…",
"@loadMore": {
"type": "text",
Expand Down Expand Up @@ -3041,10 +3041,10 @@
}
}
},
"explainPermissionToAccessContacts": "Twake chat collects your contacts only when you are on a contact search screen to find out whether your friends are on the Matrix server, enabling connection with them. Your contacts are not synchronized with our server.",
"explainPermissionToAccessMedias": "Twake chat collects your photos, videos, music, and other documents to enable sending and saving selected files. Please go to Settings > Permissions and activate Storage permission: Photos and Videos.",
"explainPermissionToAccessPhotos": "Twake chat collects your photos to enable sending and saving selected photos only when the app is in use. Press Settings > Permissions, then enable Storage permission: Photos.",
"explainPermissionToAccessVideos": "Twake chat collects your videos to enable sending and saving selected videos only when the app is in use. Press Settings > Permissions, then enable Storage permission: Videos.",
"explainPermissionToAccessContacts": "Twake Chat DOES NOT collect your contacts. Twake Chat sends only contact hashes to the Twake Chat servers to understand who from your friends already joined Twake Chat, enabling connection with them. Your contacts ARE NOT synchronized with our server.",
"explainPermissionToAccessMedias": "Twake Chat does not synchronize data between your device and our servers. We only store media that you have sent to the chat room. All media files sent to chat are encrypted and stored securely. Go to Settings > Permissions and activate the Storage: Photos and Videos permission. You can also deny access to your media library at any time.",
"explainPermissionToAccessPhotos": "Twake Chat does not synchronize data between your device and our servers. We only store media that you have sent to the chat room. All media files sent to chat are encrypted and stored securely. Go to Settings > Permissions and activate the Storage: Photos permission. You can also deny access to your media library at any time.",
"explainPermissionToAccessVideos": "Twake Chat does not synchronize data between your device and our servers. We only store media that you have sent to the chat room. All media files sent to chat are encrypted and stored securely. Go to Settings > Permissions and activate the Storage: Videos permission. You can also deny access to your media library at any time.",
"downloading": "Downloading",
"settingUpYourTwake": "Setting up your Twake\nIt could take a while",
"performingAutomaticalLogin": "Performing automatical login via SSO",
Expand Down
2 changes: 1 addition & 1 deletion lib/pages/chat/chat_app_bar_title.dart
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ class _DirectChatAppBarStatusContent extends StatelessWidget {
}
if (directChatPresence == null) {
return ChatAppBarTitleText(
text: L10n.of(context)!.loading,
text: L10n.of(context)!.loadingStatus,
);
}
final typingText = room.getLocalizedTypingText(context);
Expand Down
4 changes: 2 additions & 2 deletions lib/presentation/mixins/common_media_picker_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ mixin CommonMediaPickerMixin {
text: isMicrophone
? L10n.of(context)!.tapToAllowAccessToYourMicrophone
: L10n.of(context)!.tapToAllowAccessToYourCamera,
style: Theme.of(context).textTheme.titleSmall,
style: Theme.of(context).textTheme.bodyMedium,
children: <TextSpan>[
TextSpan(
text: ' ${L10n.of(context)!.twake}.',
style: Theme.of(context).textTheme.titleSmall!.copyWith(
style: Theme.of(context).textTheme.bodyMedium!.copyWith(
fontWeight: FontWeight.bold,
),
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ mixin class ContactsViewControllerMixin {
permission: Permission.contacts,
explainTextRequestPermission: Text(
L10n.of(context)!.explainPermissionToAccessContacts,
style: Theme.of(context).textTheme.bodyMedium,
),
onRefuseTap: _handleDenyPermissionDialog,
onAcceptButton: () async {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ mixin SaveFileToTwakeAndroidDownloadsFolderMixin {
L10n.of(context)!.explainPermissionToDownloadFiles(
AppConfig.applicationName,
),
style: Theme.of(context).textTheme.bodyMedium,
),
onAcceptButton: () =>
PermissionHandlerService().goToSettingsForPermissionActions(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ mixin SaveMediaToGalleryAndroidMixin
L10n.of(context)!.explainPermissionToGallery(
AppConfig.applicationName,
),
style: Theme.of(context).textTheme.bodyMedium,
),
onAcceptButton: () =>
permissionHandlerService.goToSettingsForPermissionActions(),
Expand Down
36 changes: 18 additions & 18 deletions lib/utils/permission_dialog.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,25 +53,24 @@ class _PermissionDialogState extends State<PermissionDialog>
borderRadius: BorderRadius.circular(28.0),
color: Theme.of(context).colorScheme.surface,
),
width: 312,
height: 280,
width: MediaQuery.sizeOf(context).width * 0.85,
padding: const EdgeInsets.symmetric(horizontal: 24.0),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (widget.icon != null) ...[
child: IntrinsicHeight(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
if (widget.icon != null) ...[
const SizedBox(
height: 24.0,
),
widget.icon!,
],
const SizedBox(
height: 24.0,
height: 16.0,
),
widget.icon!,
],
const SizedBox(
height: 16.0,
),
widget.explainTextRequestPermission,
const SizedBox(height: 24.0),
Expanded(
child: Row(
widget.explainTextRequestPermission,
const SizedBox(height: 24.0),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: [
_PermissionTextButton(
Expand All @@ -97,8 +96,9 @@ class _PermissionDialogState extends State<PermissionDialog>
),
],
),
),
],
const SizedBox(height: 24.0),
],
),
),
),
),
Expand Down
3 changes: 3 additions & 0 deletions lib/utils/permission_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ class PermissionHandlerService {
permission: Permission.photos,
explainTextRequestPermission: Text(
L10n.of(context)!.explainPermissionToAccessPhotos,
style: Theme.of(context).textTheme.bodyMedium,
),
onAcceptButton: () async {
Navigator.of(dialogContext).pop(true);
Expand All @@ -119,6 +120,7 @@ class PermissionHandlerService {
permission: Permission.videos,
explainTextRequestPermission: Text(
L10n.of(context)!.explainPermissionToAccessVideos,
style: Theme.of(context).textTheme.bodyMedium,
),
onAcceptButton: () async {
Navigator.of(dialogContext).pop(true);
Expand Down Expand Up @@ -161,6 +163,7 @@ class PermissionHandlerService {
Platform.isIOS ? Permission.photos : Permission.storage,
explainTextRequestPermission: Text(
L10n.of(context)!.explainPermissionToAccessMedias,
style: Theme.of(context).textTheme.bodyMedium,
),
onAcceptButton: () async {
Navigator.of(dialogContext).pop(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class ContactsWarningBannerView extends StatelessWidget {
Padding(
padding: ContactsWarningBannerStyle.paddingForContentBanner,
child: Text(
L10n.of(context)!.contactsWarningBannerTitle,
L10n.of(context)!.explainPermissionToAccessContacts,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface,
),
Expand Down
12 changes: 8 additions & 4 deletions lib/widgets/mixins/handle_download_and_preview_file_mixin.dart
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ mixin HandleDownloadAndPreviewFileMixin {
builder: (context) {
return PermissionDialog(
permission: Permission.storage,
explainTextRequestPermission:
Text(L10n.of(context)!.explainStoragePermission),
explainTextRequestPermission: Text(
L10n.of(context)!.explainStoragePermission,
style: Theme.of(context).textTheme.bodyMedium,
),
icon: const Icon(Icons.preview_outlined),
);
},
Expand All @@ -89,8 +91,10 @@ mixin HandleDownloadAndPreviewFileMixin {
builder: (context) {
return PermissionDialog(
permission: Permission.storage,
explainTextRequestPermission:
Text(L10n.of(context)!.explainGoToStorageSetting),
explainTextRequestPermission: Text(
L10n.of(context)!.explainGoToStorageSetting,
style: Theme.of(context).textTheme.bodyMedium,
),
icon: const Icon(Icons.preview_outlined),
);
},
Expand Down

0 comments on commit 8e1cc5c

Please sign in to comment.