From 7d99e12978e61739e104db0c73a8ff3f0eda8ea7 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 11:14:05 +0530 Subject: [PATCH 01/11] Organize imports --- lib/db/files_db.dart | 8 +++++--- lib/db/trash_db.dart | 2 +- lib/services/trash_sync_service.dart | 2 +- lib/ui/viewer/file/file_app_bar.dart | 2 +- lib/ui/viewer/file/file_bottom_bar.dart | 2 +- lib/utils/trash_diff_fetcher.dart | 3 +-- 6 files changed, 10 insertions(+), 9 deletions(-) diff --git a/lib/db/files_db.dart b/lib/db/files_db.dart index 05fd62827..8f6c7a6b7 100644 --- a/lib/db/files_db.dart +++ b/lib/db/files_db.dart @@ -7,8 +7,8 @@ import 'package:path_provider/path_provider.dart'; import "package:photos/extensions/stop_watch.dart"; import 'package:photos/models/backup_status.dart'; import 'package:photos/models/file/file.dart'; -import 'package:photos/models/file_load_result.dart'; import 'package:photos/models/file/file_type.dart'; +import 'package:photos/models/file_load_result.dart'; import 'package:photos/models/location/location.dart'; import "package:photos/models/metadata/common_keys.dart"; import "package:photos/services/filter/db_filters.dart"; @@ -580,7 +580,8 @@ class FilesDB { limit: limit, ); final files = convertToFiles(results); - final List filteredFiles = await applyDBFilters(files, filterOptions); + final List filteredFiles = + await applyDBFilters(files, filterOptions); return FileLoadResult(filteredFiles, files.length == limit); } @@ -1515,7 +1516,8 @@ class FilesDB { limit: limit, ); final files = convertToFiles(results); - final List filteredFiles = await applyDBFilters(files, filterOptions); + final List filteredFiles = + await applyDBFilters(files, filterOptions); return FileLoadResult(filteredFiles, files.length == limit); } diff --git a/lib/db/trash_db.dart b/lib/db/trash_db.dart index 3dea51f07..a4a4ae3db 100644 --- a/lib/db/trash_db.dart +++ b/lib/db/trash_db.dart @@ -4,8 +4,8 @@ import 'dart:io'; import 'package:logging/logging.dart'; import 'package:path/path.dart'; import 'package:path_provider/path_provider.dart'; -import 'package:photos/models/file_load_result.dart'; import 'package:photos/models/file/trash_file.dart'; +import 'package:photos/models/file_load_result.dart'; import 'package:sqflite/sqflite.dart'; // The TrashDB doesn't need to flatten and store all attributes of a file. diff --git a/lib/services/trash_sync_service.dart b/lib/services/trash_sync_service.dart index 137919373..e5c3ed07f 100644 --- a/lib/services/trash_sync_service.dart +++ b/lib/services/trash_sync_service.dart @@ -11,8 +11,8 @@ import 'package:photos/events/force_reload_trash_page_event.dart'; import 'package:photos/events/trash_updated_event.dart'; import 'package:photos/extensions/list.dart'; import 'package:photos/models/file/file.dart'; -import 'package:photos/models/ignored_file.dart'; import 'package:photos/models/file/trash_file.dart'; +import 'package:photos/models/ignored_file.dart'; import 'package:photos/models/trash_item_request.dart'; import 'package:photos/services/ignored_files_service.dart'; import 'package:photos/utils/trash_diff_fetcher.dart'; diff --git a/lib/ui/viewer/file/file_app_bar.dart b/lib/ui/viewer/file/file_app_bar.dart index 14bd4d32e..d9fba515e 100644 --- a/lib/ui/viewer/file/file_app_bar.dart +++ b/lib/ui/viewer/file/file_app_bar.dart @@ -12,10 +12,10 @@ import 'package:photos/events/local_photos_updated_event.dart'; import "package:photos/generated/l10n.dart"; import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file_type.dart'; +import 'package:photos/models/file/trash_file.dart'; import 'package:photos/models/ignored_file.dart'; import "package:photos/models/metadata/common_keys.dart"; import 'package:photos/models/selected_files.dart'; -import 'package:photos/models/file/trash_file.dart'; import 'package:photos/services/collections_service.dart'; import 'package:photos/services/hidden_service.dart'; import 'package:photos/services/ignored_files_service.dart'; diff --git a/lib/ui/viewer/file/file_bottom_bar.dart b/lib/ui/viewer/file/file_bottom_bar.dart index 94166edc1..ae2b6f0f5 100644 --- a/lib/ui/viewer/file/file_bottom_bar.dart +++ b/lib/ui/viewer/file/file_bottom_bar.dart @@ -5,8 +5,8 @@ import 'package:flutter/material.dart'; import "package:photos/generated/l10n.dart"; import 'package:photos/models/file/file.dart'; import 'package:photos/models/file/file_type.dart'; -import 'package:photos/models/selected_files.dart'; import 'package:photos/models/file/trash_file.dart'; +import 'package:photos/models/selected_files.dart'; import 'package:photos/theme/colors.dart'; import 'package:photos/theme/ente_theme.dart'; import "package:photos/ui/actions/file/file_actions.dart"; diff --git a/lib/utils/trash_diff_fetcher.dart b/lib/utils/trash_diff_fetcher.dart index 2b6fb95c8..ddc158771 100644 --- a/lib/utils/trash_diff_fetcher.dart +++ b/lib/utils/trash_diff_fetcher.dart @@ -3,9 +3,8 @@ import 'dart:math'; import 'package:logging/logging.dart'; import 'package:photos/core/network/network.dart'; -import "package:photos/models/metadata/file_magic.dart"; - import 'package:photos/models/file/trash_file.dart'; +import "package:photos/models/metadata/file_magic.dart"; import 'package:photos/utils/crypto_util.dart'; import 'package:photos/utils/file_download_util.dart'; From 9044f76936e99769e4ecfc807a807b55519aef19 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 11:15:04 +0530 Subject: [PATCH 02/11] Remove unused method parameter --- lib/ui/collections/collection_action_sheet.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ui/collections/collection_action_sheet.dart b/lib/ui/collections/collection_action_sheet.dart index fdd92a7b2..00d6ab92a 100644 --- a/lib/ui/collections/collection_action_sheet.dart +++ b/lib/ui/collections/collection_action_sheet.dart @@ -166,7 +166,7 @@ class _CollectionActionSheetState extends State { borderRadius: 2, ), ), - _getCollectionItems(filesCount), + _getCollectionItems(), ], ), ), @@ -198,7 +198,7 @@ class _CollectionActionSheetState extends State { ); } - Flexible _getCollectionItems(int filesCount) { + Flexible _getCollectionItems() { return Flexible( child: Padding( padding: const EdgeInsets.fromLTRB(16, 24, 4, 0), From a1d7bae702347df8926335238106a9f376a29806 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 11:59:14 +0530 Subject: [PATCH 03/11] Show option to move files to hidden album in hidden section on selection and show collectionActionSheet --- lib/models/gallery_type.dart | 7 ++++++- lib/ui/collections/album/vertical_list.dart | 2 ++ .../collections/collection_action_sheet.dart | 3 +++ .../actions/file_selection_actions_widget.dart | 18 ++++++++++++++++++ 4 files changed, 29 insertions(+), 1 deletion(-) diff --git a/lib/models/gallery_type.dart b/lib/models/gallery_type.dart index 920eca7b4..9a87fbfda 100644 --- a/lib/models/gallery_type.dart +++ b/lib/models/gallery_type.dart @@ -228,6 +228,10 @@ extension GalleyTypeExtension on GalleryType { bool showPermanentlyDeleteOption() { return this == GalleryType.trash; } + + bool showMovetoHiddenAlbum() { + return this == GalleryType.hiddenSection; + } } extension GalleryAppBarExtn on GalleryType { @@ -289,7 +293,8 @@ extension GalleryAppBarExtn on GalleryType { } bool canHide() { - return this == GalleryType.ownedCollection || this == GalleryType.hiddenOwnedCollection; + return this == GalleryType.ownedCollection || + this == GalleryType.hiddenOwnedCollection; } bool canDelete() { diff --git a/lib/ui/collections/album/vertical_list.dart b/lib/ui/collections/album/vertical_list.dart index 8c449ed17..9195b55ed 100644 --- a/lib/ui/collections/album/vertical_list.dart +++ b/lib/ui/collections/album/vertical_list.dart @@ -226,6 +226,8 @@ class AlbumVerticalListWidget extends StatelessWidget { return _showShareCollectionPage(context, collection); case CollectionActionType.collectPhotos: return _createCollaborativeLink(context, collection); + case CollectionActionType.moveToHiddenCollection: + return false; } } diff --git a/lib/ui/collections/collection_action_sheet.dart b/lib/ui/collections/collection_action_sheet.dart index 00d6ab92a..90ff63f1f 100644 --- a/lib/ui/collections/collection_action_sheet.dart +++ b/lib/ui/collections/collection_action_sheet.dart @@ -27,6 +27,7 @@ enum CollectionActionType { unHide, shareCollection, collectPhotos, + moveToHiddenCollection, } String _actionName( @@ -53,6 +54,8 @@ String _actionName( break; case CollectionActionType.collectPhotos: text = S.of(context).share; + case CollectionActionType.moveToHiddenCollection: + text = "Move to hidden album"; break; } return text; diff --git a/lib/ui/viewer/actions/file_selection_actions_widget.dart b/lib/ui/viewer/actions/file_selection_actions_widget.dart index ef5d33c49..20a41e327 100644 --- a/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -283,6 +283,16 @@ class _FileSelectionActionsWidgetState ); } + if (widget.type.showMovetoHiddenAlbum()) { + items.add( + SelectionActionButton( + icon: Icons.arrow_forward_outlined, + labelText: S.of(context).moveToAlbum, + onTap: _moveFilesToHiddenAlbum, + ), + ); + } + items.add( SelectionActionButton( icon: Icons.grid_view_outlined, @@ -332,6 +342,14 @@ class _FileSelectionActionsWidgetState ); } + Future _moveFilesToHiddenAlbum() async { + showCollectionActionSheet( + context, + selectedFiles: widget.selectedFiles, + actionType: CollectionActionType.moveToHiddenCollection, + ); + } + Future _addToAlbum() async { if (split.ownedByOtherUsers.isNotEmpty) { widget.selectedFiles From ff14768d0aee00134798a03f81d3ebb7426df7f5 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 12:59:00 +0530 Subject: [PATCH 04/11] Show only hidden albums excluding defaultHiddenAlbums in CollectionActionSheet when moving a hidden file to a hidden collection --- lib/services/collections_service.dart | 30 ++++++--- .../collections/collection_action_sheet.dart | 64 +++++++++++-------- 2 files changed, 60 insertions(+), 34 deletions(-) diff --git a/lib/services/collections_service.dart b/lib/services/collections_service.dart index b65cf3d0e..80973734f 100644 --- a/lib/services/collections_service.dart +++ b/lib/services/collections_service.dart @@ -196,11 +196,21 @@ class CollectionsService { .toList(); } - List getHiddenCollections() { - return _collectionIDToCollections.values - .toList() - .where((element) => element.isHidden()) - .toList(); + List getHiddenCollections({bool includeDefaultHidden = true}) { + if (includeDefaultHidden) { + return _collectionIDToCollections.values + .toList() + .where((element) => element.isHidden()) + .toList(); + } else { + return _collectionIDToCollections.values + .toList() + .where( + (element) => (element.isHidden() && + element.id != cachedDefaultHiddenCollection?.id), + ) + .toList(); + } } Set getHiddenCollectionIds() { @@ -902,8 +912,9 @@ class CollectionsService { collection.publicURLs?.add(PublicURL.fromMap(response.data["result"])); await _db.insert(List.from([collection])); _collectionIDToCollections[collection.id] = collection; - Bus.instance - .fire(CollectionUpdatedEvent(collection.id, [], "updateUrl")); + Bus.instance.fire( + CollectionUpdatedEvent(collection.id, [], "updateUrl"), + ); } on DioError catch (e) { if (e.response?.statusCode == 402) { throw SharingNotPermittedForFreeAccountsError(); @@ -1353,7 +1364,10 @@ class CollectionsService { } } - Future removeFromCollection(int collectionID, List files) async { + Future removeFromCollection( + int collectionID, + List files, + ) async { final params = {}; params["collectionID"] = collectionID; final batchedFiles = files.chunks(batchSize); diff --git a/lib/ui/collections/collection_action_sheet.dart b/lib/ui/collections/collection_action_sheet.dart index 90ff63f1f..42491b73d 100644 --- a/lib/ui/collections/collection_action_sheet.dart +++ b/lib/ui/collections/collection_action_sheet.dart @@ -206,7 +206,7 @@ class _CollectionActionSheetState extends State { child: Padding( padding: const EdgeInsets.fromLTRB(16, 24, 4, 0), child: FutureBuilder>( - future: _getCollectionsWithThumbnail(), + future: _getCollections(), builder: (context, snapshot) { if (snapshot.hasError) { //Need to show an error on the UI here @@ -249,34 +249,46 @@ class _CollectionActionSheetState extends State { ); } - Future> _getCollectionsWithThumbnail() async { - final List collections = - CollectionsService.instance.getCollectionsForUI( - // in collections where user is a collaborator, only addTo and remove - // action can to be performed - includeCollab: widget.actionType == CollectionActionType.addFiles, - ); - collections.sort((first, second) { - return compareAsciiLowerCaseNatural( - first.displayName, - second.displayName, + Future> _getCollections() async { + if (widget.actionType == CollectionActionType.moveToHiddenCollection) { + final hiddenCollections = CollectionsService.instance + .getHiddenCollections(includeDefaultHidden: false); + hiddenCollections.sort((first, second) { + return compareAsciiLowerCaseNatural( + first.displayName, + second.displayName, + ); + }); + return hiddenCollections; + } else { + final List collections = + CollectionsService.instance.getCollectionsForUI( + // in collections where user is a collaborator, only addTo and remove + // action can to be performed + includeCollab: widget.actionType == CollectionActionType.addFiles, ); - }); - final List pinned = []; - final List unpinned = []; - for (final collection in collections) { - if (collection.isQuickLinkCollection() || - collection.type == CollectionType.favorites || - collection.type == CollectionType.uncategorized) { - continue; - } - if (collection.isPinned) { - pinned.add(collection); - } else { - unpinned.add(collection); + collections.sort((first, second) { + return compareAsciiLowerCaseNatural( + first.displayName, + second.displayName, + ); + }); + final List pinned = []; + final List unpinned = []; + for (final collection in collections) { + if (collection.isQuickLinkCollection() || + collection.type == CollectionType.favorites || + collection.type == CollectionType.uncategorized) { + continue; + } + if (collection.isPinned) { + pinned.add(collection); + } else { + unpinned.add(collection); + } } + return pinned + unpinned; } - return pinned + unpinned; } void _removeIncomingCollections(List items) { From e378b4a8eb381442175ed5855ce66be2b56c4165 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 13:18:33 +0530 Subject: [PATCH 05/11] Move to hidden album: Move files upon selecting an album from CollectinActionSheet --- lib/ui/collections/album/vertical_list.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/ui/collections/album/vertical_list.dart b/lib/ui/collections/album/vertical_list.dart index 9195b55ed..808ff0920 100644 --- a/lib/ui/collections/album/vertical_list.dart +++ b/lib/ui/collections/album/vertical_list.dart @@ -186,6 +186,8 @@ class AlbumVerticalListWidget extends StatelessWidget { actionType == CollectionActionType.unHide) { toastMessage = S.of(context).movedSuccessfullyTo(item.displayName); shouldNavigateToCollection = true; + } else if (actionType == CollectionActionType.moveToHiddenCollection) { + toastMessage = S.of(context).movedSuccessfullyTo(item.displayName); } else { toastMessage = ""; } @@ -227,7 +229,7 @@ class AlbumVerticalListWidget extends StatelessWidget { case CollectionActionType.collectPhotos: return _createCollaborativeLink(context, collection); case CollectionActionType.moveToHiddenCollection: - return false; + return _moveFilesToCollection(context, collection.id); } } @@ -412,9 +414,14 @@ class AlbumVerticalListWidget extends StatelessWidget { BuildContext context, int toCollectionID, ) async { - final String message = actionType == CollectionActionType.moveFiles - ? S.of(context).movingFilesToAlbum - : S.of(context).unhidingFilesToAlbum; + late final String message; + if (actionType == CollectionActionType.moveFiles || + actionType == CollectionActionType.moveToHiddenCollection) { + message = S.of(context).movingFilesToAlbum; + } else { + message = S.of(context).unhidingFilesToAlbum; + } + final dialog = createProgressDialog(context, message, isDismissible: true); await dialog.show(); try { From f26c7841efc662ed8edf5864ed24100456dcbdeb Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 13:26:07 +0530 Subject: [PATCH 06/11] Move to hidden album: Navigate to album to which files were moved to --- lib/ui/collections/album/vertical_list.dart | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/ui/collections/album/vertical_list.dart b/lib/ui/collections/album/vertical_list.dart index 808ff0920..ea76cdfd9 100644 --- a/lib/ui/collections/album/vertical_list.dart +++ b/lib/ui/collections/album/vertical_list.dart @@ -178,6 +178,8 @@ class AlbumVerticalListWidget extends StatelessWidget { if (await _runCollectionAction(context, item)) { late final String toastMessage; bool shouldNavigateToCollection = false; + bool hasVerifiedLock = false; + if (actionType == CollectionActionType.addFiles) { toastMessage = S.of(context).addedSuccessfullyTo(item.displayName); shouldNavigateToCollection = true; @@ -188,6 +190,8 @@ class AlbumVerticalListWidget extends StatelessWidget { shouldNavigateToCollection = true; } else if (actionType == CollectionActionType.moveToHiddenCollection) { toastMessage = S.of(context).movedSuccessfullyTo(item.displayName); + shouldNavigateToCollection = true; + hasVerifiedLock = true; } else { toastMessage = ""; } @@ -201,6 +205,7 @@ class AlbumVerticalListWidget extends StatelessWidget { _navigateToCollection( context, item, + hasVerifiedLock: hasVerifiedLock, ); } } @@ -233,12 +238,17 @@ class AlbumVerticalListWidget extends StatelessWidget { } } - void _navigateToCollection(BuildContext context, Collection collection) { + void _navigateToCollection( + BuildContext context, + Collection collection, { + bool hasVerifiedLock = false, + }) { Navigator.pop(context); routeToPage( context, CollectionPage( CollectionWithThumbnail(collection, null), + hasVerifiedLock: hasVerifiedLock, ), ); } From 18d835db3c607bcb2cd4c6324698270598988927 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 15:46:49 +0530 Subject: [PATCH 07/11] Move to hidden album: Add support for moving between hidden albums --- lib/models/gallery_type.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/models/gallery_type.dart b/lib/models/gallery_type.dart index 9a87fbfda..e57028203 100644 --- a/lib/models/gallery_type.dart +++ b/lib/models/gallery_type.dart @@ -230,7 +230,8 @@ extension GalleyTypeExtension on GalleryType { } bool showMovetoHiddenAlbum() { - return this == GalleryType.hiddenSection; + return this == GalleryType.hiddenSection || + this == GalleryType.hiddenOwnedCollection; } } From 837b489c56887def6bde0ad3ba7c5eebdcad67b2 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Sat, 26 Aug 2023 15:47:28 +0530 Subject: [PATCH 08/11] Move to hidden album: Add support for creating a new hidden album from CollectionActionSheet --- lib/services/hidden_service.dart | 24 +++++++++++++++++---- lib/ui/collections/album/vertical_list.dart | 19 ++++++++++++++-- 2 files changed, 37 insertions(+), 6 deletions(-) diff --git a/lib/services/hidden_service.dart b/lib/services/hidden_service.dart index fcb9be5ff..97c21af24 100644 --- a/lib/services/hidden_service.dart +++ b/lib/services/hidden_service.dart @@ -130,7 +130,8 @@ extension HiddenService on CollectionsService { final defaultHiddenCollection = await getDefaultHiddenCollection(); final Map> collectionToFilesMap = await filesDB.getAllFilesGroupByCollectionID(uploadedIDs); - for (MapEntry> entry in collectionToFilesMap.entries) { + for (MapEntry> entry + in collectionToFilesMap.entries) { if (entry.key == defaultHiddenCollection.id) { _logger.finest('file already part of hidden collection'); continue; @@ -161,11 +162,11 @@ extension HiddenService on CollectionsService { return true; } - Future _createDefaultHiddenAlbum() async { + Future createHiddenAlbum(String name) async { final CreateRequest createRequest = await buildCollectionCreateRequest( - ".Hidden", + name, visibility: hiddenVisibility, - subType: subTypeDefaultHidden, + subType: 0, ); _logger.info("Creating Hidden Collection"); final collection = await createAndCacheCollection(createRequest); @@ -176,6 +177,21 @@ extension HiddenService on CollectionsService { return collectionFromServer; } + Future _createDefaultHiddenAlbum() async { + final CreateRequest createRequest = await buildCollectionCreateRequest( + ".Hidden", + visibility: hiddenVisibility, + subType: subTypeDefaultHidden, + ); + _logger.info("Creating Default Hidden Collection"); + final collection = await createAndCacheCollection(createRequest); + _logger.info("Default Hidden Collection Created Successfully"); + final Collection collectionFromServer = + await fetchCollectionByID(collection.id); + _logger.info("Fetched Created Default Hidden Collection Successfully"); + return collectionFromServer; + } + Future _createUncategorizedCollection() async { final uncategorizedCollectionKey = CryptoUtil.generateKey(); final encKey = diff --git a/lib/ui/collections/album/vertical_list.dart b/lib/ui/collections/album/vertical_list.dart index ea76cdfd9..3e754ead0 100644 --- a/lib/ui/collections/album/vertical_list.dart +++ b/lib/ui/collections/album/vertical_list.dart @@ -13,6 +13,7 @@ import 'package:photos/models/collection/collection_items.dart'; import 'package:photos/models/file/file.dart'; import 'package:photos/models/selected_files.dart'; import 'package:photos/services/collections_service.dart'; +import "package:photos/services/hidden_service.dart"; import 'package:photos/services/ignored_files_service.dart'; import 'package:photos/services/remote_sync_service.dart'; import "package:photos/ui/actions/collection/collection_sharing_actions.dart"; @@ -136,7 +137,17 @@ class AlbumVerticalListWidget extends StatelessWidget { Future _nameAlbum(BuildContext context, String albumName) async { if (albumName.isNotEmpty) { - final collection = await _createAlbum(albumName); + bool hasVerifiedLock = false; + late final Collection? collection; + + if (actionType == CollectionActionType.moveToHiddenCollection) { + collection = + await CollectionsService.instance.createHiddenAlbum(albumName); + hasVerifiedLock = true; + } else { + collection = await _createAlbum(albumName); + } + if (collection != null) { if (await _runCollectionAction( context, @@ -154,7 +165,11 @@ class AlbumVerticalListWidget extends StatelessWidget { "Album '" + albumName + "' created.", ); } - _navigateToCollection(context, collection); + _navigateToCollection( + context, + collection, + hasVerifiedLock: hasVerifiedLock, + ); } } } From 1a6d1117b36aa0dab33063018e9165ce7ec65414 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 28 Aug 2023 17:22:54 +0530 Subject: [PATCH 09/11] Add support for 'Add to hidden album' --- lib/models/gallery_type.dart | 5 +++ lib/ui/collections/album/vertical_list.dart | 6 +++ .../collections/collection_action_sheet.dart | 14 ++++++- .../file_selection_actions_widget.dart | 39 ++++++++++++++----- 4 files changed, 53 insertions(+), 11 deletions(-) diff --git a/lib/models/gallery_type.dart b/lib/models/gallery_type.dart index e57028203..c12816939 100644 --- a/lib/models/gallery_type.dart +++ b/lib/models/gallery_type.dart @@ -233,6 +233,11 @@ extension GalleyTypeExtension on GalleryType { return this == GalleryType.hiddenSection || this == GalleryType.hiddenOwnedCollection; } + + bool showAddtoHiddenAlbum() { + return this == GalleryType.hiddenSection || + this == GalleryType.hiddenOwnedCollection; + } } extension GalleryAppBarExtn on GalleryType { diff --git a/lib/ui/collections/album/vertical_list.dart b/lib/ui/collections/album/vertical_list.dart index 3e754ead0..3ec583672 100644 --- a/lib/ui/collections/album/vertical_list.dart +++ b/lib/ui/collections/album/vertical_list.dart @@ -207,6 +207,10 @@ class AlbumVerticalListWidget extends StatelessWidget { toastMessage = S.of(context).movedSuccessfullyTo(item.displayName); shouldNavigateToCollection = true; hasVerifiedLock = true; + } else if (actionType == CollectionActionType.addToHiddenAlbum) { + toastMessage = S.of(context).addedSuccessfullyTo(item.displayName); + shouldNavigateToCollection = true; + hasVerifiedLock = true; } else { toastMessage = ""; } @@ -250,6 +254,8 @@ class AlbumVerticalListWidget extends StatelessWidget { return _createCollaborativeLink(context, collection); case CollectionActionType.moveToHiddenCollection: return _moveFilesToCollection(context, collection.id); + case CollectionActionType.addToHiddenAlbum: + return _addToCollection(context, collection.id, showProgressDialog); } } diff --git a/lib/ui/collections/collection_action_sheet.dart b/lib/ui/collections/collection_action_sheet.dart index 42491b73d..20164cd2d 100644 --- a/lib/ui/collections/collection_action_sheet.dart +++ b/lib/ui/collections/collection_action_sheet.dart @@ -27,6 +27,7 @@ enum CollectionActionType { unHide, shareCollection, collectPhotos, + addToHiddenAlbum, moveToHiddenCollection, } @@ -54,6 +55,8 @@ String _actionName( break; case CollectionActionType.collectPhotos: text = S.of(context).share; + case CollectionActionType.addToHiddenAlbum: + text = "Add to hidden album"; case CollectionActionType.moveToHiddenCollection: text = "Move to hidden album"; break; @@ -109,9 +112,18 @@ class CollectionActionSheet extends StatefulWidget { } class _CollectionActionSheetState extends State { + late final bool _showOnlyHiddenCollections; static const int cancelButtonSize = 80; String _searchQuery = ""; + @override + void initState() { + super.initState(); + _showOnlyHiddenCollections = + widget.actionType == CollectionActionType.moveToHiddenCollection || + widget.actionType == CollectionActionType.addToHiddenAlbum; + } + @override Widget build(BuildContext context) { final filesCount = widget.sharedFiles != null @@ -250,7 +262,7 @@ class _CollectionActionSheetState extends State { } Future> _getCollections() async { - if (widget.actionType == CollectionActionType.moveToHiddenCollection) { + if (_showOnlyHiddenCollections) { final hiddenCollections = CollectionsService.instance .getHiddenCollections(includeDefaultHidden: false); hiddenCollections.sort((first, second) { diff --git a/lib/ui/viewer/actions/file_selection_actions_widget.dart b/lib/ui/viewer/actions/file_selection_actions_widget.dart index 20a41e327..ff5a4d7aa 100644 --- a/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -171,6 +171,17 @@ class _FileSelectionActionsWidgetState ); } } + + if (widget.type.showAddtoHiddenAlbum()) { + items.add( + SelectionActionButton( + icon: Icons.add_outlined, + labelText: S.of(context).addToAlbum, + onTap: _addToHiddenAlbum, + ), + ); + } + if (widget.type.showMoveToAlbum()) { items.add( SelectionActionButton( @@ -182,6 +193,16 @@ class _FileSelectionActionsWidgetState ); } + if (widget.type.showMovetoHiddenAlbum()) { + items.add( + SelectionActionButton( + icon: Icons.arrow_forward_outlined, + labelText: S.of(context).moveToAlbum, + onTap: _moveFilesToHiddenAlbum, + ), + ); + } + if (widget.type.showRemoveFromAlbum()) { items.add( SelectionActionButton( @@ -283,16 +304,6 @@ class _FileSelectionActionsWidgetState ); } - if (widget.type.showMovetoHiddenAlbum()) { - items.add( - SelectionActionButton( - icon: Icons.arrow_forward_outlined, - labelText: S.of(context).moveToAlbum, - onTap: _moveFilesToHiddenAlbum, - ), - ); - } - items.add( SelectionActionButton( icon: Icons.grid_view_outlined, @@ -358,6 +369,14 @@ class _FileSelectionActionsWidgetState showCollectionActionSheet(context, selectedFiles: widget.selectedFiles); } + Future _addToHiddenAlbum() async { + showCollectionActionSheet( + context, + selectedFiles: widget.selectedFiles, + actionType: CollectionActionType.addToHiddenAlbum, + ); + } + Future _onDeleteClick() async { return showDeleteSheet(context, widget.selectedFiles); } From b8bc2798928c9a19da070f26a40c8225d20d745c Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 28 Aug 2023 18:27:38 +0530 Subject: [PATCH 10/11] Add support for removing an item from a hidden album --- lib/models/gallery_type.dart | 4 +++ .../collection/collection_file_actions.dart | 8 +++--- .../collection_sharing_actions.dart | 27 +++++++++++++------ .../file_selection_actions_widget.dart | 20 ++++++++++++++ 4 files changed, 48 insertions(+), 11 deletions(-) diff --git a/lib/models/gallery_type.dart b/lib/models/gallery_type.dart index c12816939..a90ba8f95 100644 --- a/lib/models/gallery_type.dart +++ b/lib/models/gallery_type.dart @@ -238,6 +238,10 @@ extension GalleyTypeExtension on GalleryType { return this == GalleryType.hiddenSection || this == GalleryType.hiddenOwnedCollection; } + + bool showRemoveFromHiddenAlbum() { + return this == GalleryType.hiddenOwnedCollection; + } } extension GalleryAppBarExtn on GalleryType { diff --git a/lib/ui/actions/collection/collection_file_actions.dart b/lib/ui/actions/collection/collection_file_actions.dart index 503f47b9e..b89f44b80 100644 --- a/lib/ui/actions/collection/collection_file_actions.dart +++ b/lib/ui/actions/collection/collection_file_actions.dart @@ -29,8 +29,9 @@ extension CollectionFileActions on CollectionActions { BuildContext bContext, Collection collection, SelectedFiles selectedFiles, - bool removingOthersFile, - ) async { + bool removingOthersFile, { + bool isHidden = false, + }) async { final actionResult = await showActionSheet( context: bContext, buttons: [ @@ -47,6 +48,7 @@ extension CollectionFileActions on CollectionActions { bContext, collection, selectedFiles.files, + isHidden: isHidden, ); } catch (e) { logger.severe("Failed to move files", e); @@ -159,7 +161,7 @@ extension CollectionFileActions on CollectionActions { files.add(uploadedFile); } } else { - for(final file in filesPendingUpload) { + for (final file in filesPendingUpload) { file.collectionID = collectionID; } // filesPendingUpload might be getting ignored during auto-upload diff --git a/lib/ui/actions/collection/collection_sharing_actions.dart b/lib/ui/actions/collection/collection_sharing_actions.dart index 596abe201..970189c31 100644 --- a/lib/ui/actions/collection/collection_sharing_actions.dart +++ b/lib/ui/actions/collection/collection_sharing_actions.dart @@ -71,7 +71,7 @@ class CollectionActions { labelText: S.of(context).yesRemove, onTap: () async { // for quickLink collection, we need to trash the collection - if(collection.isQuickLinkCollection() && !collection.hasSharees) { + if (collection.isQuickLinkCollection() && !collection.hasSharees) { await trashCollectionKeepingPhotos(collection, context); } else { await CollectionsService.instance.disableShareUrl(collection); @@ -364,7 +364,10 @@ class CollectionActions { return false; } - Future trashCollectionKeepingPhotos(Collection collection, BuildContext bContext) async { + Future trashCollectionKeepingPhotos( + Collection collection, + BuildContext bContext, + ) async { final List files = await FilesDB.instance.getAllFilesCollection(collection.id); await moveFilesFromCurrentCollection(bContext, collection, files); @@ -409,8 +412,9 @@ class CollectionActions { Future moveFilesFromCurrentCollection( BuildContext context, Collection collection, - Iterable files, - ) async { + Iterable files, { + bool isHidden = false, + }) async { final int currentUserID = Configuration.instance.getUserID()!; final isCollectionOwner = collection.owner!.id == currentUserID; final FilesSplit split = FilesSplit.split( @@ -480,9 +484,15 @@ class CollectionActions { } // Move the remaining files to uncategorized collection if (pendingAssignMap.isNotEmpty) { - final Collection uncategorizedCollection = - await collectionsService.getUncategorizedCollection(); - final int toCollectionID = uncategorizedCollection.id; + late final int toCollectionID; + if (isHidden) { + toCollectionID = collectionsService.cachedDefaultHiddenCollection!.id; + } else { + final Collection uncategorizedCollection = + await collectionsService.getUncategorizedCollection(); + toCollectionID = uncategorizedCollection.id; + } + for (MapEntry entry in pendingAssignMap.entries) { final file = entry.value; if (pendingAssignMap.containsKey(file.uploadedFileID)) { @@ -507,7 +517,8 @@ class CollectionActions { ); } - for (MapEntry> entry in destCollectionToFilesMap.entries) { + for (MapEntry> entry + in destCollectionToFilesMap.entries) { await collectionsService.move(entry.key, collection.id, entry.value); } } diff --git a/lib/ui/viewer/actions/file_selection_actions_widget.dart b/lib/ui/viewer/actions/file_selection_actions_widget.dart index ff5a4d7aa..7e4585dbb 100644 --- a/lib/ui/viewer/actions/file_selection_actions_widget.dart +++ b/lib/ui/viewer/actions/file_selection_actions_widget.dart @@ -214,6 +214,16 @@ class _FileSelectionActionsWidgetState ); } + if (widget.type.showRemoveFromHiddenAlbum()) { + items.add( + SelectionActionButton( + icon: Icons.remove_outlined, + labelText: S.of(context).removeFromAlbum, + onTap: _removeFilesFromHiddenAlbum, + ), + ); + } + if (widget.type.showDeleteOption()) { items.add( SelectionActionButton( @@ -400,6 +410,16 @@ class _FileSelectionActionsWidgetState ); } + Future _removeFilesFromHiddenAlbum() async { + await collectionActions.showRemoveFromCollectionSheetV2( + context, + widget.collection!, + widget.selectedFiles, + false, + isHidden: true, + ); + } + Future _onFavoriteClick() async { final result = await collectionActions.updateFavorites( context, From ff1f53b86742b4ae0d04db29684e03026a0873c4 Mon Sep 17 00:00:00 2001 From: ashilkn Date: Mon, 28 Aug 2023 21:50:06 +0530 Subject: [PATCH 11/11] Extract strings --- lib/generated/intl/messages_cs.dart | 7 ++++++- lib/generated/intl/messages_de.dart | 4 ++++ lib/generated/intl/messages_en.dart | 4 ++++ lib/generated/intl/messages_es.dart | 4 ++++ lib/generated/intl/messages_fr.dart | 4 ++++ lib/generated/intl/messages_it.dart | 4 ++++ lib/generated/intl/messages_ko.dart | 7 ++++++- lib/generated/intl/messages_nl.dart | 4 ++++ lib/generated/intl/messages_no.dart | 4 ++++ lib/generated/intl/messages_pl.dart | 4 ++++ lib/generated/intl/messages_pt.dart | 4 ++++ lib/generated/intl/messages_zh.dart | 4 ++++ lib/generated/l10n.dart | 20 +++++++++++++++++++ lib/l10n/intl_cs.arb | 5 ++++- lib/l10n/intl_de.arb | 6 ++++-- lib/l10n/intl_en.arb | 6 ++++-- lib/l10n/intl_es.arb | 6 ++++-- lib/l10n/intl_fr.arb | 4 +++- lib/l10n/intl_it.arb | 4 +++- lib/l10n/intl_ko.arb | 5 ++++- lib/l10n/intl_nl.arb | 6 ++++-- lib/l10n/intl_no.arb | 6 ++++-- lib/l10n/intl_pl.arb | 6 ++++-- lib/l10n/intl_pt.arb | 6 ++++-- lib/l10n/intl_zh.arb | 6 ++++-- .../collections/collection_action_sheet.dart | 4 ++-- 26 files changed, 120 insertions(+), 24 deletions(-) diff --git a/lib/generated/intl/messages_cs.dart b/lib/generated/intl/messages_cs.dart index 2bfb5800f..0799f30d7 100644 --- a/lib/generated/intl/messages_cs.dart +++ b/lib/generated/intl/messages_cs.dart @@ -21,5 +21,10 @@ class MessageLookup extends MessageLookupByLibrary { String get localeName => 'cs'; final messages = _notInlinedMessages(_notInlinedMessages); - static Map _notInlinedMessages(_) => {}; + static Map _notInlinedMessages(_) => { + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album") + }; } diff --git a/lib/generated/intl/messages_de.dart b/lib/generated/intl/messages_de.dart index 37c5a3f51..72429d453 100644 --- a/lib/generated/intl/messages_de.dart +++ b/lib/generated/intl/messages_de.dart @@ -218,6 +218,8 @@ class MessageLookup extends MessageLookupByLibrary { "addToAlbum": MessageLookupByLibrary.simpleMessage("Zum Album hinzufügen"), "addToEnte": MessageLookupByLibrary.simpleMessage("Zu ente hinzufügen"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Album teilen"), "addedAs": MessageLookupByLibrary.simpleMessage("Hinzugefügt als"), "addedBy": m1, @@ -829,6 +831,8 @@ class MessageLookup extends MessageLookupByLibrary { "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Zum Album verschieben"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage( "In den Papierkorb verschoben"), diff --git a/lib/generated/intl/messages_en.dart b/lib/generated/intl/messages_en.dart index 5afed0964..5fe04c9a4 100644 --- a/lib/generated/intl/messages_en.dart +++ b/lib/generated/intl/messages_en.dart @@ -225,6 +225,8 @@ class MessageLookup extends MessageLookupByLibrary { "addSelected": MessageLookupByLibrary.simpleMessage("Add selected"), "addToAlbum": MessageLookupByLibrary.simpleMessage("Add to album"), "addToEnte": MessageLookupByLibrary.simpleMessage("Add to ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Add viewer"), "addedAs": MessageLookupByLibrary.simpleMessage("Added as"), "addedBy": m1, @@ -827,6 +829,8 @@ class MessageLookup extends MessageLookupByLibrary { "monthly": MessageLookupByLibrary.simpleMessage("Monthly"), "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Move to album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("Moved to trash"), "movingFilesToAlbum": diff --git a/lib/generated/intl/messages_es.dart b/lib/generated/intl/messages_es.dart index 18199891f..f1cac6b1a 100644 --- a/lib/generated/intl/messages_es.dart +++ b/lib/generated/intl/messages_es.dart @@ -214,6 +214,8 @@ class MessageLookup extends MessageLookupByLibrary { "addMore": MessageLookupByLibrary.simpleMessage("Añadir más"), "addToAlbum": MessageLookupByLibrary.simpleMessage("Añadir al álbum"), "addToEnte": MessageLookupByLibrary.simpleMessage("Añadir a ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Añadir espectador"), "addedAs": MessageLookupByLibrary.simpleMessage("Agregado como"), "addedBy": m1, @@ -792,6 +794,8 @@ class MessageLookup extends MessageLookupByLibrary { "monthly": MessageLookupByLibrary.simpleMessage("Mensual"), "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Mover al álbum"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("Movido a la papelera"), diff --git a/lib/generated/intl/messages_fr.dart b/lib/generated/intl/messages_fr.dart index 57e7fd20a..982f4f29b 100644 --- a/lib/generated/intl/messages_fr.dart +++ b/lib/generated/intl/messages_fr.dart @@ -232,6 +232,8 @@ class MessageLookup extends MessageLookupByLibrary { "addToAlbum": MessageLookupByLibrary.simpleMessage("Ajouter à l\'album"), "addToEnte": MessageLookupByLibrary.simpleMessage("Ajouter à ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Ajouter un observateur"), "addedAs": MessageLookupByLibrary.simpleMessage("Ajouté comme"), @@ -875,6 +877,8 @@ class MessageLookup extends MessageLookupByLibrary { "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Déplacer vers l\'album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("Déplacé dans la corbeille"), diff --git a/lib/generated/intl/messages_it.dart b/lib/generated/intl/messages_it.dart index 541ea9979..4cad869c4 100644 --- a/lib/generated/intl/messages_it.dart +++ b/lib/generated/intl/messages_it.dart @@ -229,6 +229,8 @@ class MessageLookup extends MessageLookupByLibrary { "addToAlbum": MessageLookupByLibrary.simpleMessage("Aggiungi all\'album"), "addToEnte": MessageLookupByLibrary.simpleMessage("Aggiungi su ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Aggiungi in sola lettura"), "addedAs": MessageLookupByLibrary.simpleMessage("Aggiunto come"), @@ -858,6 +860,8 @@ class MessageLookup extends MessageLookupByLibrary { "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Sposta nell\'album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("Spostato nel cestino"), diff --git a/lib/generated/intl/messages_ko.dart b/lib/generated/intl/messages_ko.dart index 8d8edc845..eeb3867f5 100644 --- a/lib/generated/intl/messages_ko.dart +++ b/lib/generated/intl/messages_ko.dart @@ -21,5 +21,10 @@ class MessageLookup extends MessageLookupByLibrary { String get localeName => 'ko'; final messages = _notInlinedMessages(_notInlinedMessages); - static Map _notInlinedMessages(_) => {}; + static Map _notInlinedMessages(_) => { + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album") + }; } diff --git a/lib/generated/intl/messages_nl.dart b/lib/generated/intl/messages_nl.dart index d5eea489b..e385bd58a 100644 --- a/lib/generated/intl/messages_nl.dart +++ b/lib/generated/intl/messages_nl.dart @@ -233,6 +233,8 @@ class MessageLookup extends MessageLookupByLibrary { "addToAlbum": MessageLookupByLibrary.simpleMessage("Toevoegen aan album"), "addToEnte": MessageLookupByLibrary.simpleMessage("Toevoegen aan ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Voeg kijker toe"), "addedAs": MessageLookupByLibrary.simpleMessage("Toegevoegd als"), "addedBy": m1, @@ -860,6 +862,8 @@ class MessageLookup extends MessageLookupByLibrary { "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("Verplaats naar album"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("Naar prullenbak verplaatst"), diff --git a/lib/generated/intl/messages_no.dart b/lib/generated/intl/messages_no.dart index 7687b21c6..78cba6687 100644 --- a/lib/generated/intl/messages_no.dart +++ b/lib/generated/intl/messages_no.dart @@ -24,6 +24,8 @@ class MessageLookup extends MessageLookupByLibrary { static Map _notInlinedMessages(_) => { "accountWelcomeBack": MessageLookupByLibrary.simpleMessage("Velkommen tilbake!"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "askDeleteReason": MessageLookupByLibrary.simpleMessage( "Hva er hovedårsaken til at du sletter kontoen din?"), "cancel": MessageLookupByLibrary.simpleMessage("Avbryt"), @@ -44,6 +46,8 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Ugyldig e-postadresse"), "kindlyHelpUsWithThisInformation": MessageLookupByLibrary.simpleMessage( "Vær vennlig og hjelp oss med denne informasjonen"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "verify": MessageLookupByLibrary.simpleMessage("Bekreft") }; } diff --git a/lib/generated/intl/messages_pl.dart b/lib/generated/intl/messages_pl.dart index 3c79f72bf..0d0002ed4 100644 --- a/lib/generated/intl/messages_pl.dart +++ b/lib/generated/intl/messages_pl.dart @@ -28,6 +28,8 @@ class MessageLookup extends MessageLookupByLibrary { "accountWelcomeBack": MessageLookupByLibrary.simpleMessage("Witaj ponownie!"), "activeSessions": MessageLookupByLibrary.simpleMessage("Aktywne sesje"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "askDeleteReason": MessageLookupByLibrary.simpleMessage( "Jaka jest przyczyna usunięcia konta?"), "cancel": MessageLookupByLibrary.simpleMessage("Anuluj"), @@ -107,6 +109,8 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Pomóż nam z tą informacją"), "logInLabel": MessageLookupByLibrary.simpleMessage("Zaloguj się"), "moderateStrength": MessageLookupByLibrary.simpleMessage("Umiarkowana"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "noRecoveryKey": MessageLookupByLibrary.simpleMessage("Brak klucza odzyskiwania?"), "noRecoveryKeyNoDecryption": MessageLookupByLibrary.simpleMessage( diff --git a/lib/generated/intl/messages_pt.dart b/lib/generated/intl/messages_pt.dart index 3b3dcb541..6d4ec8b31 100644 --- a/lib/generated/intl/messages_pt.dart +++ b/lib/generated/intl/messages_pt.dart @@ -73,6 +73,8 @@ class MessageLookup extends MessageLookupByLibrary { "addCollaborator": MessageLookupByLibrary.simpleMessage("Adicionar colaborador"), "addMore": MessageLookupByLibrary.simpleMessage("Adicione mais"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("Adicionar visualizador"), "addedAs": MessageLookupByLibrary.simpleMessage("Adicionado como"), @@ -257,6 +259,8 @@ class MessageLookup extends MessageLookupByLibrary { MessageLookupByLibrary.simpleMessage("Dispositivo perdido?"), "manage": MessageLookupByLibrary.simpleMessage("Gerenciar"), "moderateStrength": MessageLookupByLibrary.simpleMessage("Moderada"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "noRecoveryKey": MessageLookupByLibrary.simpleMessage( "Nenhuma chave de recuperação?"), "noRecoveryKeyNoDecryption": MessageLookupByLibrary.simpleMessage( diff --git a/lib/generated/intl/messages_zh.dart b/lib/generated/intl/messages_zh.dart index 53e10b98f..743ce0093 100644 --- a/lib/generated/intl/messages_zh.dart +++ b/lib/generated/intl/messages_zh.dart @@ -203,6 +203,8 @@ class MessageLookup extends MessageLookupByLibrary { "addSelected": MessageLookupByLibrary.simpleMessage("添加所选项"), "addToAlbum": MessageLookupByLibrary.simpleMessage("添加到相册"), "addToEnte": MessageLookupByLibrary.simpleMessage("添加到 ente"), + "addToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Add to hidden album"), "addViewer": MessageLookupByLibrary.simpleMessage("添加查看者"), "addedAs": MessageLookupByLibrary.simpleMessage("已添加为"), "addedBy": m1, @@ -702,6 +704,8 @@ class MessageLookup extends MessageLookupByLibrary { "monthly": MessageLookupByLibrary.simpleMessage("每月"), "moveItem": m29, "moveToAlbum": MessageLookupByLibrary.simpleMessage("移动到相册"), + "moveToHiddenAlbum": + MessageLookupByLibrary.simpleMessage("Move to hidden album"), "movedSuccessfullyTo": m30, "movedToTrash": MessageLookupByLibrary.simpleMessage("已移至回收站"), "movingFilesToAlbum": diff --git a/lib/generated/l10n.dart b/lib/generated/l10n.dart index db1981b00..3a077add0 100644 --- a/lib/generated/l10n.dart +++ b/lib/generated/l10n.dart @@ -7644,6 +7644,26 @@ class S { args: [], ); } + + /// `Add to hidden album` + String get addToHiddenAlbum { + return Intl.message( + 'Add to hidden album', + name: 'addToHiddenAlbum', + desc: '', + args: [], + ); + } + + /// `Move to hidden album` + String get moveToHiddenAlbum { + return Intl.message( + 'Move to hidden album', + name: 'moveToHiddenAlbum', + desc: '', + args: [], + ); + } } class AppLocalizationDelegate extends LocalizationsDelegate { diff --git a/lib/l10n/intl_cs.arb b/lib/l10n/intl_cs.arb index 0967ef424..0d61ea996 100644 --- a/lib/l10n/intl_cs.arb +++ b/lib/l10n/intl_cs.arb @@ -1 +1,4 @@ -{} +{ + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_de.arb b/lib/l10n/intl_de.arb index 2c5cb9397..b3b3b0473 100644 --- a/lib/l10n/intl_de.arb +++ b/lib/l10n/intl_de.arb @@ -1047,5 +1047,7 @@ }, "maps": "Karten", "enableMaps": "Karten aktivieren", - "enableMapsDesc": "Dies zeigt Ihre Fotos auf einer Weltkarte.\n\nDiese Karte wird von OpenStreetMap gehostet und die genauen Standorte Ihrer Fotos werden niemals geteilt.\n\nSie können diese Funktion jederzeit in den Einstellungen deaktivieren." -} + "enableMapsDesc": "Dies zeigt Ihre Fotos auf einer Weltkarte.\n\nDiese Karte wird von OpenStreetMap gehostet und die genauen Standorte Ihrer Fotos werden niemals geteilt.\n\nSie können diese Funktion jederzeit in den Einstellungen deaktivieren.", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_en.arb b/lib/l10n/intl_en.arb index b1b09d22a..4d79745c1 100644 --- a/lib/l10n/intl_en.arb +++ b/lib/l10n/intl_en.arb @@ -1100,5 +1100,7 @@ "unhiding": "Unhiding...", "successfullyHid": "Successfully hid", "successfullyUnhid": "Successfully unhid", - "crashReporting": "Crash reporting" -} + "crashReporting": "Crash reporting", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_es.arb b/lib/l10n/intl_es.arb index e7f09b83c..dc31fceb7 100644 --- a/lib/l10n/intl_es.arb +++ b/lib/l10n/intl_es.arb @@ -962,5 +962,7 @@ }, "setRadius": "Establecer radio", "familyPlanPortalTitle": "Familia", - "familyPlanOverview": "Añada 5 familiares a su plan existente sin pagar más.\n\nCada miembro tiene su propio espacio privado y no puede ver los archivos del otro a menos que sean compartidos.\n\nLos planes familiares están disponibles para los clientes que tienen una suscripción de ente pagada.\n\n¡Suscríbete ahora para empezar!" -} + "familyPlanOverview": "Añada 5 familiares a su plan existente sin pagar más.\n\nCada miembro tiene su propio espacio privado y no puede ver los archivos del otro a menos que sean compartidos.\n\nLos planes familiares están disponibles para los clientes que tienen una suscripción de ente pagada.\n\n¡Suscríbete ahora para empezar!", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_fr.arb b/lib/l10n/intl_fr.arb index 8e8f83bd1..5ca6b74b6 100644 --- a/lib/l10n/intl_fr.arb +++ b/lib/l10n/intl_fr.arb @@ -1100,5 +1100,7 @@ "unhiding": "Démasquage en cours...", "successfullyHid": "Masquage réussi", "successfullyUnhid": "Masquage réussi", - "crashReporting": "Rapports d'erreurs" + "crashReporting": "Rapports d'erreurs", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" } \ No newline at end of file diff --git a/lib/l10n/intl_it.arb b/lib/l10n/intl_it.arb index a21c803f7..ff3b01310 100644 --- a/lib/l10n/intl_it.arb +++ b/lib/l10n/intl_it.arb @@ -1099,5 +1099,7 @@ "unhiding": "Rimuovendo dal nascondiglio...", "successfullyHid": "Nascosta con successo", "successfullyUnhid": "Rimossa dal nascondiglio con successo", - "crashReporting": "Segnalazione di crash" + "crashReporting": "Segnalazione di crash", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" } \ No newline at end of file diff --git a/lib/l10n/intl_ko.arb b/lib/l10n/intl_ko.arb index 0967ef424..0d61ea996 100644 --- a/lib/l10n/intl_ko.arb +++ b/lib/l10n/intl_ko.arb @@ -1 +1,4 @@ -{} +{ + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_nl.arb b/lib/l10n/intl_nl.arb index f3bab0c5b..80c18bf25 100644 --- a/lib/l10n/intl_nl.arb +++ b/lib/l10n/intl_nl.arb @@ -1095,5 +1095,7 @@ "sharedByYou": "Gedeeld door jou", "inviteYourFriendsToEnte": "Vrienden uitnodigen voor ente", "failedToDownloadVideo": "Downloaden van video mislukt", - "crashReporting": "Crash rapportering" -} + "crashReporting": "Crash rapportering", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_no.arb b/lib/l10n/intl_no.arb index f35e9afbe..ea60f01d0 100644 --- a/lib/l10n/intl_no.arb +++ b/lib/l10n/intl_no.arb @@ -12,5 +12,7 @@ "feedback": "Tilbakemelding", "kindlyHelpUsWithThisInformation": "Vær vennlig og hjelp oss med denne informasjonen", "confirmDeletePrompt": "Ja, jeg ønsker å slette denne kontoen og all dataen dens permanent.", - "confirmAccountDeletion": "Bekreft sletting av konto" -} + "confirmAccountDeletion": "Bekreft sletting av konto", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_pl.arb b/lib/l10n/intl_pl.arb index ce50dec51..ea72904c6 100644 --- a/lib/l10n/intl_pl.arb +++ b/lib/l10n/intl_pl.arb @@ -100,5 +100,7 @@ "codeCopiedToClipboard": "Kod został skopiowany do schowka", "confirm": "Potwierdź", "twofactorAuthenticationPageTitle": "Uwierzytelnianie dwuskładnikowe", - "tryAgain": "Spróbuj ponownie" -} + "tryAgain": "Spróbuj ponownie", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_pt.arb b/lib/l10n/intl_pt.arb index 3da6d37a6..1c9c03fe2 100644 --- a/lib/l10n/intl_pt.arb +++ b/lib/l10n/intl_pt.arb @@ -266,5 +266,7 @@ "update": "Atualização", "installManually": "Instalar manualmente", "criticalUpdateAvailable": "Atualização crítica disponível", - "updateAvailable": "Atualização disponível" -} + "updateAvailable": "Atualização disponível", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/l10n/intl_zh.arb b/lib/l10n/intl_zh.arb index 1b26880f5..726ce6b9f 100644 --- a/lib/l10n/intl_zh.arb +++ b/lib/l10n/intl_zh.arb @@ -1095,5 +1095,7 @@ "sharedByYou": "您共享的", "inviteYourFriendsToEnte": "邀请您的好友加入ente", "failedToDownloadVideo": "视频下载失败", - "crashReporting": "崩溃报告" -} + "crashReporting": "崩溃报告", + "addToHiddenAlbum": "Add to hidden album", + "moveToHiddenAlbum": "Move to hidden album" +} \ No newline at end of file diff --git a/lib/ui/collections/collection_action_sheet.dart b/lib/ui/collections/collection_action_sheet.dart index c498f955b..370982c8a 100644 --- a/lib/ui/collections/collection_action_sheet.dart +++ b/lib/ui/collections/collection_action_sheet.dart @@ -56,9 +56,9 @@ String _actionName( case CollectionActionType.collectPhotos: text = S.of(context).share; case CollectionActionType.addToHiddenAlbum: - text = "Add to hidden album"; + text = S.of(context).addToHiddenAlbum; case CollectionActionType.moveToHiddenCollection: - text = "Move to hidden album"; + text = S.of(context).moveToHiddenAlbum; break; } return text;