π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Show add to album in shared viewer
ashilkn262fc9c5e04c
diff --git a/mobile/apps/photos/changes/show-add-to-album-in-shared-viewer.md b/mobile/apps/photos/changes/show-add-to-album-in-shared-viewer.mdnew file mode 100644index 0000000000..c556956cdb--- /dev/null+++ b/mobile/apps/photos/changes/show-add-to-album-in-shared-viewer.md@@ -0,0 +1 @@+- Show Add to album directly in the gallery viewer for shared photos.diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dartindex 62c533cd98..daa6b2b140 100644--- a/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/file_app_bar.dart@@ -74,7 +74,6 @@ class FileAppBarState extends State<FileAppBar> {bool isGuestView = false;bool shouldLoopVideo = localSettings.shouldLoopVideo();bool _reloadActions = false;- ValueNotifier<bool>? _isInSharedCollectionNotifier;ValueNotifier<String?>? _showingThumbnailFallbackNotifier;@override@@ -103,31 +102,15 @@ class FileAppBarState extends State<FileAppBar> {void didChangeDependencies() {super.didChangeDependencies();final detailPageState = InheritedDetailPageState.maybeOf(context);- _updateIsInSharedCollectionNotifier(- detailPageState?.isInSharedCollectionNotifier,- );_updateShowingThumbnailFallbackNotifier(detailPageState?.showingThumbnailFallbackNotifier,);}- void _onSharedCollectionChanged() {- _requestActionsReload();- }-void _onThumbnailFallbackChanged() {_requestActionsReload();}- void _updateIsInSharedCollectionNotifier(ValueNotifier<bool>? notifier) {- if (_isInSharedCollectionNotifier == notifier) {- return;- }- _isInSharedCollectionNotifier?.removeListener(_onSharedCollectionChanged);- _isInSharedCollectionNotifier = notifier;- _isInSharedCollectionNotifier?.addListener(_onSharedCollectionChanged);- }-void _updateShowingThumbnailFallbackNotifier(ValueNotifier<String?>? notifier,) {@@ -143,7 +126,6 @@ class FileAppBarState extends State<FileAppBar> {@overridevoid dispose() {- _isInSharedCollectionNotifier?.removeListener(_onSharedCollectionChanged);_showingThumbnailFallbackNotifier?.removeListener(_onThumbnailFallbackChanged,);@@ -274,11 +256,6 @@ class FileAppBarState extends State<FileAppBar> {final Collection? collection = collectionID != null? CollectionsService.instance.getCollectionByID(collectionID): null;- final isInSharedCollection =- InheritedDetailPageState.maybeOf(- context,- )?.isInSharedCollectionNotifier.value ??- false;bool isFileHidden = false;if (isOwnedByUser && isFileUploaded) {isFileHidden = collection?.isHidden() ?? false;@@ -353,17 +330,6 @@ class FileAppBarState extends State<FileAppBar> {),);}- // Add to Album option - shown when file is in shared collection- // (moved from bottom bar to make room for social icons)- if (isInSharedCollection && isFileUploaded && !isFileHidden) {- items.add(- _fileMenuOption(- AppLocalizations.of(context).addToAlbum,- value: 10,- hugeIcon: HugeIcons.strokeRoundedImageAdd01,- ),- );- }// options for files owned by the userif (isOwnedByUser && !isFileHidden && isFileUploaded) {final bool isArchived =@@ -562,14 +528,6 @@ class FileAppBarState extends State<FileAppBar> {if (collection != null) {await _handleSuggestDelete(collection);}- } else if (value == 10) {- final selectedFiles = SelectedFiles();- selectedFiles.files.add(widget.file);- await showCollectionActionSheet(- context,- selectedFiles: selectedFiles,- actionType: CollectionActionType.addFiles,- );}}diff --git a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dartindex e179696946..51a5650547 100644--- a/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart+++ b/mobile/apps/photos/lib/ui/viewer/file/file_bottom_bar.dart@@ -168,9 +168,7 @@ class FileBottomBarState extends State<FileBottomBar> {),);- // Add to album button for uploaded, non-hidden files- // Hide when in shared collection (moved to app bar popup menu)- if (widget.file.isUploaded && !isFileHidden && !isInSharedCollection) {+ if (widget.file.isUploaded && !isFileHidden) {children.add(Tooltip(message: AppLocalizations.of(context).addToAlbum,