Skip to content

armgit / ente

Public Imported from GitHub
0

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

Make gallery configurable to not show PinnedGroupHeader and use it where necessary

ashilkn3578df0ac05f
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
index 122c1c845f..750d555b00 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery.dart
@@ -74,6 +74,7 @@ class Gallery extends StatefulWidget {
// add a Function variable to get sort value in bool
final SortAscFn? sortAsyncFn;
final GroupType groupType;
+ final bool disablePinnedGroupHeader;
const Gallery({
required this.asyncLoader,
@@ -98,6 +99,7 @@ class Gallery extends StatefulWidget {
this.isScrollablePositionedList = true,
this.reloadDebounceTime = const Duration(milliseconds: 500),
this.reloadDebounceExecutionInterval = const Duration(seconds: 2),
+ this.disablePinnedGroupHeader = false,
super.key,
});
@@ -588,7 +590,8 @@ class GalleryState extends State<Gallery> {
),
],
),
- galleryGroups.groupType.showGroupHeader()
+ galleryGroups.groupType.showGroupHeader() &&
+ !widget.disablePinnedGroupHeader
? PinnedGroupHeader(
scrollController: _scrollController,
galleryGroups: galleryGroups,
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
index 245530dfbc..93f54f75ea 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/add_photos_sheet.dart
@@ -311,6 +311,7 @@ class _DelayedGalleryState extends State<DelayedGallery> {
selectedFiles: widget.selectedFiles,
showSelectAll: true,
sortAsyncFn: () => false,
+ disablePinnedGroupHeader: true,
).animate().fadeIn(
duration: const Duration(milliseconds: 175),
curve: Curves.easeOutCirc,
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
index 6fe52a232c..b65ef9bf53 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_cover_photo.dart
@@ -115,12 +115,13 @@ class PickCoverPhotoWidget extends StatelessWidget {
(event) =>
event.collectionID == collection.id,
),
- tagPrefix: "pick_center_point_gallery",
+ tagPrefix: "pick_cover_photo_gallery",
selectedFiles: selectedFiles,
limitSelectionToOne: true,
showSelectAll: false,
sortAsyncFn: () =>
collection.pubMagicMetadata.asc ?? false,
+ disablePinnedGroupHeader: true,
),
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
index c432fad5b9..bdc67c5bff 100644
--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/pick_person_avatar.dart
@@ -120,6 +120,7 @@ class PickPersonCoverPhotoWidget extends StatelessWidget {
selectedFiles: selectedFiles,
limitSelectionToOne: true,
showSelectAll: false,
+ disablePinnedGroupHeader: true,
),
),
),
diff --git a/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart b/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
index 6e4243abe0..7d685c3fd0 100644
--- a/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
+++ b/mobile/apps/photos/lib/ui/viewer/location/pick_center_point_widget.dart
@@ -122,6 +122,7 @@ class PickCenterPointWidget extends StatelessWidget {
"You can also add a location centered on a photo from the photo's info screen",
),
),
+ disablePinnedGroupHeader: true,
),
),
),