Show only relevat actions for hidden collection and it's files

This commit is contained in:
ashilkn 2023-08-15 15:46:59 +05:30
parent 4af99ea2f0
commit 3d4bb87891
4 changed files with 15 additions and 6 deletions

View file

@ -6,6 +6,7 @@ import "package:photos/core/event_bus.dart";
import "package:photos/events/collection_updated_event.dart"; import "package:photos/events/collection_updated_event.dart";
import "package:photos/generated/l10n.dart"; import "package:photos/generated/l10n.dart";
import "package:photos/models/collection.dart"; import "package:photos/models/collection.dart";
import "package:photos/models/gallery_type.dart";
import "package:photos/theme/ente_theme.dart"; import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/collections/album/row_item.dart"; import "package:photos/ui/collections/album/row_item.dart";
import "package:photos/ui/common/loading_widget.dart"; import "package:photos/ui/common/loading_widget.dart";
@ -13,10 +14,12 @@ import "package:photos/ui/common/loading_widget.dart";
class AlbumHorizontalList extends StatefulWidget { class AlbumHorizontalList extends StatefulWidget {
final Future<List<Collection>> Function() collectionsFuture; final Future<List<Collection>> Function() collectionsFuture;
final bool? hasVerifiedLock; final bool? hasVerifiedLock;
final GalleryType? galleryType;
const AlbumHorizontalList( const AlbumHorizontalList(
this.collectionsFuture, { this.collectionsFuture, {
this.hasVerifiedLock, this.hasVerifiedLock,
this.galleryType,
Key? key, Key? key,
}) : super(key: key); }) : super(key: key);
@ -89,6 +92,7 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {
120, 120,
showFileCount: false, showFileCount: false,
hasVerifiedLock: widget.hasVerifiedLock, hasVerifiedLock: widget.hasVerifiedLock,
galleryType: widget.galleryType,
); );
}, },
), ),

View file

@ -21,6 +21,7 @@ class AlbumRowItemWidget extends StatelessWidget {
final bool showFileCount; final bool showFileCount;
final String tag; final String tag;
final bool? hasVerifiedLock; final bool? hasVerifiedLock;
final GalleryType? galleryType;
const AlbumRowItemWidget( const AlbumRowItemWidget(
this.c, this.c,
@ -29,6 +30,7 @@ class AlbumRowItemWidget extends StatelessWidget {
this.showFileCount = true, this.showFileCount = true,
this.tag = "", this.tag = "",
this.hasVerifiedLock, this.hasVerifiedLock,
this.galleryType,
}); });
@override @override
@ -195,11 +197,13 @@ class AlbumRowItemWidget extends StatelessWidget {
CollectionPage( CollectionPage(
CollectionWithThumbnail(c, thumbnail), CollectionWithThumbnail(c, thumbnail),
tagPrefix: tagPrefix, tagPrefix: tagPrefix,
appBarType: isOwner appBarType: galleryType == null
? (c.type == CollectionType.favorites ? isOwner
? GalleryType.favorite ? (c.type == CollectionType.favorites
: GalleryType.ownedCollection) ? GalleryType.favorite
: GalleryType.sharedCollection, : GalleryType.ownedCollection)
: GalleryType.sharedCollection
: galleryType!,
hasVerifiedLock: hasVerifiedLock, hasVerifiedLock: hasVerifiedLock,
), ),
); );

View file

@ -80,7 +80,7 @@ class HiddenCollectionsButtonWidget extends StatelessWidget {
if (hasAuthenticated) { if (hasAuthenticated) {
routeToPage( routeToPage(
context, context,
HiddenPage(), const HiddenPage(),
); );
} }
}, },

View file

@ -122,6 +122,7 @@ class _HiddenPageState extends State<HiddenPage> {
initialFiles: null, initialFiles: null,
emptyState: const EmptyHiddenWidget(), emptyState: const EmptyHiddenWidget(),
header: AlbumHorizontalList( header: AlbumHorizontalList(
galleryType: GalleryType.hidden,
() async { () async {
return _hiddenCollectionsExcludingDefault; return _hiddenCollectionsExcludingDefault;
}, },