Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[mob][photos] Add option in overflow menu to show pin for shared albums

Neeraj Gupta5159ea8b0cd9
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
index 53f1926b7f..d4d2c706d3 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart
@@ -103,6 +103,7 @@ enum AlbumPopupAction {
setCover,
addPhotos,
pinAlbum,
+ shareePinAlbum,
removeLink,
cleanUncategorized,
downloadAlbum,
@@ -599,6 +600,19 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
icon:
isQuickLink ? Icons.remove_circle_outline : Icons.delete_outline,
),
+ if (galleryType == GalleryType.sharedCollection)
+ EntePopupMenuItem(
+ widget.collection!.hasShareePinned()
+ ? AppLocalizations.of(context).unpinAlbum
+ : AppLocalizations.of(context).pinAlbum,
+ value: AlbumPopupAction.shareePinAlbum,
+ iconWidget: widget.collection!.hasShareePinned()
+ ? const Icon(CupertinoIcons.pin_slash)
+ : Transform.rotate(
+ angle: 45 * math.pi / 180,
+ child: const Icon(CupertinoIcons.pin),
+ ),
+ ),
if (galleryType == GalleryType.sharedCollection)
EntePopupMenuItem(
widget.collection!.hasShareeArchived()
@@ -651,6 +665,13 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {
widget.collection!.isPinned ? 0 : 1,
);
if (mounted) setState(() {});
+ } else if (value == AlbumPopupAction.shareePinAlbum) {
+ await updateShareeOrder(
+ context,
+ widget.collection!,
+ widget.collection!.hasShareePinned() ? 0 : 1,
+ );
+ if (mounted) setState(() {});
} else if (value == AlbumPopupAction.ownedArchive) {
await archiveOrUnarchive();
} else if (value == AlbumPopupAction.ownedHide) {