π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
Show view all in archive and hidden section
Neeraj Gupta8dd8b5e8d431
diff --git a/mobile/apps/photos/lib/ui/collections/album/all_albums_page.dart b/mobile/apps/photos/lib/ui/collections/album/all_albums_page.dartnew file mode 100644index 0000000000..7667c60e5d--- /dev/null+++ b/mobile/apps/photos/lib/ui/collections/album/all_albums_page.dart@@ -0,0 +1,44 @@+import "package:flutter/material.dart";+import "package:photos/models/collection/collection.dart";+import "package:photos/ui/collections/flex_grid_view.dart";+import "package:photos/ui/components/title_bar_title_widget.dart";+import "package:photos/ui/components/title_bar_widget.dart";++class AllAlbumsPage extends StatelessWidget {+ final List<Collection> collections;+ final String title;+ final bool? hasVerifiedLock;++ const AllAlbumsPage({+ required this.collections,+ required this.title,+ this.hasVerifiedLock,+ super.key,+ });++ @override+ Widget build(BuildContext context) {+ return Scaffold(+ body: CustomScrollView(+ primary: false,+ slivers: <Widget>[+ TitleBarWidget(+ flexibleSpaceTitle: TitleBarTitleWidget(+ title: title,+ ),+ ),+ SliverPadding(+ padding: const EdgeInsets.symmetric(horizontal: 16, vertical: 12),+ sliver: SliverToBoxAdapter(+ child: CollectionsFlexiGridViewWidget(+ collections,+ displayLimitCount: collections.length,+ shrinkWrap: true,+ ),+ ),+ ),+ ],+ ),+ );+ }+}diff --git a/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart b/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dartindex a216b113c8..ac9cf04e1b 100644--- a/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart+++ b/mobile/apps/photos/lib/ui/collections/album/horizontal_list.dart@@ -1,7 +1,7 @@import "dart:async";import "dart:math";-import "package:flutter/cupertino.dart";+import "package:flutter/material.dart";import "package:logging/logging.dart";import "package:photos/core/event_bus.dart";import "package:photos/events/collection_updated_event.dart";@@ -14,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 VoidCallback? onViewAllTapped;const AlbumHorizontalList(this.collectionsFuture, {this.hasVerifiedLock,+ this.onViewAllTapped,super.key,});@@ -69,18 +71,46 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {if (snapshot.data!.isEmpty) {return const SizedBox.shrink();}- final collections = snapshot.data as List<Collection>;+ final allCollections = snapshot.data as List<Collection>;+ final hasMore = allCollections.length > 3;+ final displayCollections =+ hasMore ? allCollections.sublist(0, 3) : allCollections;+return Padding(padding: const EdgeInsets.only(bottom: 24, top: 8),child: Column(crossAxisAlignment: CrossAxisAlignment.start,children: [- Padding(- padding:- const EdgeInsets.symmetric(horizontal: 16, vertical: 12),- child: Text(- AppLocalizations.of(context).albums,- style: getEnteTextTheme(context).large,+ GestureDetector(+ onTap: hasMore && widget.onViewAllTapped != null+ ? widget.onViewAllTapped+ : null,+ child: Padding(+ padding: const EdgeInsets.symmetric(+ horizontal: 16,+ vertical: 12,+ ),+ child: Row(+ mainAxisAlignment: MainAxisAlignment.spaceBetween,+ children: [+ Text(+ AppLocalizations.of(context).albums,+ style: getEnteTextTheme(context).large,+ ),+ if (hasMore && widget.onViewAllTapped != null)+ Container(+ color: Colors.transparent,+ child: Padding(+ padding: const EdgeInsets.fromLTRB(24, 0, 0, 0),+ child: Icon(+ Icons.chevron_right_outlined,+ color: getEnteColorScheme(context)+ .blurStrokePressed,+ ),+ ),+ ),+ ],+ ),),),Align(@@ -89,12 +119,12 @@ class _AlbumHorizontalListState extends State<AlbumHorizontalList> {height: sideOfThumbnail + 46,child: ListView.builder(scrollDirection: Axis.horizontal,- itemCount: collections.length,+ itemCount: displayCollections.length,padding: const EdgeInsets.symmetric(horizontal: horizontalPadding / 2,),itemBuilder: (context, index) {- final item = collections[index];+ final item = displayCollections[index];return Padding(key: ValueKey('horizontal_list_${item.id}'),padding: const EdgeInsets.only(diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/archive_page.dart b/mobile/apps/photos/lib/ui/viewer/gallery/archive_page.dartindex 321bb5936c..83f23d25d8 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/archive_page.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/archive_page.dart@@ -10,6 +10,7 @@ import "package:photos/models/metadata/common_keys.dart";import 'package:photos/models/selected_files.dart';import 'package:photos/services/collections_service.dart';import "package:photos/services/filter/db_filters.dart";+import "package:photos/ui/collections/album/all_albums_page.dart";import "package:photos/ui/collections/album/horizontal_list.dart";import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';import "package:photos/ui/viewer/gallery/empty_state.dart";@@ -18,6 +19,7 @@ import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';import "package:photos/ui/viewer/gallery/state/gallery_boundaries_provider.dart";import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.dart";import "package:photos/ui/viewer/gallery/state/selection_state.dart";+import "package:photos/utils/navigation_util.dart";class ArchivePage extends StatelessWidget {final String tagPrefix;@@ -78,6 +80,19 @@ class ArchivePage extends StatelessWidget {),header: AlbumHorizontalList(CollectionsService.instance.getArchivedCollection,+ onViewAllTapped: () async {+ final collections =+ await CollectionsService.instance.getArchivedCollection();+ if (context.mounted) {+ await routeToPage(+ context,+ AllAlbumsPage(+ collections: collections,+ title: AppLocalizations.of(context).archive,+ ),+ );+ }+ },),);return GalleryBoundariesProvider(diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hidden_page.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hidden_page.dartindex 73b100e20b..fb28ce35a5 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/hidden_page.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hidden_page.dart@@ -13,6 +13,7 @@ import 'package:photos/models/gallery_type.dart';import 'package:photos/models/selected_files.dart';import 'package:photos/services/collections_service.dart';import "package:photos/services/hidden_service.dart";+import "package:photos/ui/collections/album/all_albums_page.dart";import "package:photos/ui/collections/album/horizontal_list.dart";import "package:photos/ui/common/loading_widget.dart";import 'package:photos/ui/viewer/actions/file_selection_overlay_bar.dart';@@ -22,6 +23,7 @@ import 'package:photos/ui/viewer/gallery/gallery_app_bar_widget.dart';import "package:photos/ui/viewer/gallery/state/gallery_boundaries_provider.dart";import "package:photos/ui/viewer/gallery/state/gallery_files_inherited_widget.dart";import "package:photos/ui/viewer/gallery/state/selection_state.dart";+import "package:photos/utils/navigation_util.dart";class HiddenPage extends StatefulWidget {final String tagPrefix;@@ -131,6 +133,16 @@ class _HiddenPageState extends State<HiddenPage> {return _hiddenCollectionsExcludingDefault;},hasVerifiedLock: true,+ onViewAllTapped: () async {+ await routeToPage(+ context,+ AllAlbumsPage(+ collections: _hiddenCollectionsExcludingDefault,+ title: AppLocalizations.of(context).hidden,+ hasVerifiedLock: true,+ ),+ );+ },),);return GalleryBoundariesProvider(