π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mob][locker] Refresh loading dialogs for file and collection actions (#13644)
aman-pilot98ae761edcdf
diff --git a/mobile/apps/locker/changes/action-loading-dialogs.md b/mobile/apps/locker/changes/action-loading-dialogs.mdnew file mode 100644index 0000000000..266e4e31af--- /dev/null+++ b/mobile/apps/locker/changes/action-loading-dialogs.md@@ -0,0 +1 @@+- Refreshed loading dialogs for offline saves, file edits, adding to collections, Important actions and file/collection deletions for internal users.diff --git a/mobile/apps/locker/lib/services/files/offline/offline_files_service.dart b/mobile/apps/locker/lib/services/files/offline/offline_files_service.dartindex 9d81f4d7b2..b59fc95025 100644--- a/mobile/apps/locker/lib/services/files/offline/offline_files_service.dart+++ b/mobile/apps/locker/lib/services/files/offline/offline_files_service.dart@@ -1,6 +1,5 @@import 'package:ente_events/event_bus.dart';import 'package:ente_strings/ente_strings.dart';-import 'package:ente_ui/utils/dialog_util.dart';import 'package:ente_ui/utils/toast_util.dart';import 'package:flutter/material.dart';import 'package:locker/events/collections_updated_event.dart';@@ -10,6 +9,7 @@ import 'package:locker/services/files/download/file_downloader.dart';import 'package:locker/services/files/offline/offline_file_storage.dart';import 'package:locker/services/files/sync/models/file.dart';import 'package:locker/services/info_file_service.dart';+import 'package:locker/ui/components/locker_progress_dialog.dart';import 'package:logging/logging.dart';class OfflineFilesService {@@ -70,17 +70,14 @@ class OfflineFilesService {: null;final dialog = savingOffline == null? null- : createProgressDialog(+ : await showLockerProgressDialog(context,total == 1 ? savingOffline : '$savingOffline 0/$total',- isDismissible: false,);var successCount = 0;var failureCount = 0;- await dialog?.show();-try {for (var index = 0; index < eligibleFiles.length; index++) {final file = eligibleFiles[index];diff --git a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dartindex acd71c016a..38008944c6 100644--- a/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart+++ b/mobile/apps/locker/lib/ui/viewer/actions/file_selection_overlay_bar.dart@@ -20,6 +20,7 @@ import "package:locker/services/files/sync/models/file.dart";import "package:locker/services/trash/trash_service.dart";import "package:locker/ui/components/add_to_collection_sheet.dart";import "package:locker/ui/components/delete_confirmation_sheet.dart";+import "package:locker/ui/components/locker_progress_dialog.dart";import "package:locker/ui/components/selection_action_button_widget.dart";import "package:locker/utils/bottom_sheet_illustration.dart";import "package:locker/utils/collection_list_util.dart";@@ -644,15 +645,9 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {'${result.selectedCollections.length} selected collection(s).',);final dialog = context.mounted- ? createProgressDialog(- context,- context.strings.pleaseWait,- isDismissible: false,- )+ ? await showLockerProgressDialog(context, context.strings.pleaseWait): null;- await dialog?.show();-try {final addFutures = <Future<void>>[];@@ -772,16 +767,10 @@ class _FileSelectionOverlayBarState extends State<FileSelectionOverlayBar> {}final dialog = context.mounted- ? createProgressDialog(- context,- context.strings.deletingFile,- isDismissible: false,- )+ ? await showLockerProgressDialog(context, context.strings.deletingFile): null;try {- await dialog?.show();-for (final file in ownedFiles) {final collections = await CollectionService.instance.getCollectionsForFile(file);diff --git a/mobile/apps/locker/lib/utils/collection_actions.dart b/mobile/apps/locker/lib/utils/collection_actions.dartindex 049c10a362..3d8cadc96f 100644--- a/mobile/apps/locker/lib/utils/collection_actions.dart+++ b/mobile/apps/locker/lib/utils/collection_actions.dart@@ -132,10 +132,9 @@ class CollectionActions {if (dialogChoice == null) return;- ProgressDialog? progressDialog;+ LockerProgressDialog? progressDialog;if (context.mounted) {- progressDialog = createProgressDialog(context, l10n.pleaseWait);- await progressDialog.show();+ progressDialog = await showLockerProgressDialog(context, l10n.pleaseWait);}bool isFavoriteCollection = false;@@ -243,10 +242,12 @@ class CollectionActions {final fileCount = await CollectionService.instance.getFileCount(collection);if (fileCount == 0) {- ProgressDialog? progressDialog;+ LockerProgressDialog? progressDialog;if (context.mounted) {- progressDialog = createProgressDialog(context, l10n.pleaseWait);- await progressDialog.show();+ progressDialog = await showLockerProgressDialog(+ context,+ l10n.pleaseWait,+ );}try {@@ -285,10 +286,9 @@ class CollectionActions {return;}- ProgressDialog? progressDialog;+ LockerProgressDialog? progressDialog;if (context.mounted) {- progressDialog = createProgressDialog(context, l10n.pleaseWait);- await progressDialog.show();+ progressDialog = await showLockerProgressDialog(context, l10n.pleaseWait);}try {diff --git a/mobile/apps/locker/lib/utils/file_actions.dart b/mobile/apps/locker/lib/utils/file_actions.dartindex 6a4ba2073e..f68711c0ab 100644--- a/mobile/apps/locker/lib/utils/file_actions.dart+++ b/mobile/apps/locker/lib/utils/file_actions.dart@@ -14,6 +14,7 @@ import "package:locker/services/trash/models/trash_file.dart";import "package:locker/services/trash/trash_service.dart";import "package:locker/ui/components/delete_confirmation_sheet.dart";import "package:locker/ui/components/file_edit_sheet.dart";+import "package:locker/ui/components/locker_progress_dialog.dart";import "package:locker/ui/components/share_link_sheet.dart";import "package:locker/ui/components/subscription_required_sheet.dart";import "package:locker/ui/pages/account_credentials_page.dart";@@ -74,13 +75,8 @@ class FileActions {.getCollections();final dialog = context.mounted- ? createProgressDialog(- context,- context.strings.pleaseWait,- isDismissible: false,- )+ ? await showLockerProgressDialog(context, context.strings.pleaseWait): null;- await dialog?.show();try {final currentTitle = file.displayName;@@ -295,16 +291,10 @@ class FileActions {}final dialog = context.mounted- ? createProgressDialog(- context,- context.strings.deletingFile,- isDismissible: false,- )+ ? await showLockerProgressDialog(context, context.strings.deletingFile): null;try {- await dialog?.show();-final collections = await CollectionService.instance.getCollectionsForFile(file);if (collections.isNotEmpty) {@@ -351,16 +341,10 @@ class FileActions {}final dialog = context.mounted- ? createProgressDialog(- context,- context.strings.deletingFile,- isDismissible: false,- )+ ? await showLockerProgressDialog(context, context.strings.deletingFile): null;try {- await dialog?.show();-for (final file in files) {final collections = await CollectionService.instance.getCollectionsForFile(file);@@ -405,17 +389,14 @@ class FileActions {VoidCallback? onSuccess,}) async {final isCurrentlyImportant = isImportant(file);- final dialog = createProgressDialog(+ final dialog = await showLockerProgressDialog(context,isCurrentlyImportant? context.strings.removingFromImportant: context.strings.markingAsImportant,- isDismissible: false,);try {- await dialog.show();-if (isCurrentlyImportant) {await FavoritesService.instance.removeFromFavorites(file);} else {@@ -449,15 +430,12 @@ class FileActions {List<EnteFile> files, {VoidCallback? onSuccess,}) async {- final dialog = createProgressDialog(+ final dialog = await showLockerProgressDialog(context,context.strings.markingAsImportant,- isDismissible: false,);try {- await dialog.show();-final filesToMark = files.where((file) => !FavoritesService.instance.isFavoriteCache(file)).toList();