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/generated/l10n.dart";
import "package:photos/models/collection.dart";
import "package:photos/models/gallery_type.dart";
import "package:photos/theme/ente_theme.dart";
import "package:photos/ui/collections/album/row_item.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 {
final Future<List<Collection>> Function() collectionsFuture;
final bool? hasVerifiedLock;
final GalleryType? galleryType;
const AlbumHorizontalList(
this.collectionsFuture, {
this.hasVerifiedLock,
this.galleryType,
Key? key,
}) : super(key: key);
@ -89,6 +92,7 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {
120,
showFileCount: false,
hasVerifiedLock: widget.hasVerifiedLock,
galleryType: widget.galleryType,
);
},
),

View file

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

View file

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

View file

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