diff --git a/lib/ui/collection_page.dart b/lib/ui/collection_page.dart index d7b2e3d4e..9265267b2 100644 --- a/lib/ui/collection_page.dart +++ b/lib/ui/collection_page.dart @@ -19,7 +19,7 @@ class CollectionPage extends StatelessWidget { CollectionPage(this.c, {this.tagPrefix = "collection", - this.appBarType = GalleryAppBarType.collection, + this.appBarType = GalleryAppBarType.owned_collection, Key key}) : super(key: key); diff --git a/lib/ui/gallery_app_bar_widget.dart b/lib/ui/gallery_app_bar_widget.dart index 86b71acd6..68a3639bd 100644 --- a/lib/ui/gallery_app_bar_widget.dart +++ b/lib/ui/gallery_app_bar_widget.dart @@ -20,10 +20,10 @@ import 'package:photos/utils/toast_util.dart'; enum GalleryAppBarType { homepage, local_folder, + // indicator for gallery view of collections shared with the user shared_collection, - collection, - search_results, - incoming_collection, + owned_collection, + search_results } class GalleryAppBarWidget extends StatefulWidget { @@ -106,7 +106,7 @@ class _GalleryAppBarWidgetState extends State { List actions = []; if (Configuration.instance.hasConfiguredAccount() && (widget.type == GalleryAppBarType.local_folder || - widget.type == GalleryAppBarType.collection)) { + widget.type == GalleryAppBarType.owned_collection)) { actions.add(IconButton( icon: Icon(Icons.person_add), onPressed: () { @@ -168,7 +168,7 @@ class _GalleryAppBarWidgetState extends State { List actions = []; // skip add button for incoming collection till this feature is implemented if (Configuration.instance.hasConfiguredAccount() && - widget.type != GalleryAppBarType.incoming_collection) { + widget.type != GalleryAppBarType.shared_collection) { actions.add(IconButton( icon: Icon(Platform.isAndroid ? Icons.add_outlined : CupertinoIcons.add), @@ -193,9 +193,7 @@ class _GalleryAppBarWidgetState extends State { _showDeleteSheet(context); }, )); - } else if (widget.type == GalleryAppBarType.collection || - (widget.type == GalleryAppBarType.shared_collection && - widget.collection.owner.id == Configuration.instance.getUserID())) { + } else if (widget.type == GalleryAppBarType.owned_collection) { if (widget.collection.type == CollectionType.folder) { actions.add(IconButton( icon: Icon(Platform.isAndroid diff --git a/lib/ui/shared_collections_gallery.dart b/lib/ui/shared_collections_gallery.dart index 655b9df2e..14deb8e8e 100644 --- a/lib/ui/shared_collections_gallery.dart +++ b/lib/ui/shared_collections_gallery.dart @@ -347,6 +347,7 @@ class OutgoingCollectionItem extends StatelessWidget { onTap: () { final page = CollectionPage( c, + appBarType: GalleryAppBarType.owned_collection, tagPrefix: "outgoing_collection", ); routeToPage(context, page); @@ -422,7 +423,7 @@ class IncomingCollectionItem extends StatelessWidget { routeToPage( context, CollectionPage(c, - appBarType: GalleryAppBarType.incoming_collection, + appBarType: GalleryAppBarType.shared_collection, tagPrefix: "shared_collection")); }, );