Skip to content

armgit / ente

Public Imported from GitHub
0

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

Make picker galleries full-width in landscape

ashilkn9fef2ecd19de
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 29e3d7ace2..fadcc3dcf6 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
@@ -1,5 +1,3 @@
-import "dart:math";
-
import "package:flutter/foundation.dart";
import "package:flutter/material.dart";
import "package:flutter_animate/flutter_animate.dart";
@@ -72,52 +70,48 @@ class AddPhotosPhotoWidget extends StatelessWidget {
hiddenCollectionIDs.add(collection.id);
return Padding(
- padding: const EdgeInsets.all(0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: min(428, MediaQuery.of(context).size.width),
- ),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ child: SizedBox(
+ width: double.infinity,
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Expanded(
child: Column(
- mainAxisSize: MainAxisSize.max,
children: [
+ _AppBarWithBoundary(
+ child: BottomOfTitleBarWidget(
+ title: TitleBarTitleWidget(
+ title: AppLocalizations.of(context).addMore,
+ ),
+ caption: AppLocalizations.of(context).selectItemsToAdd,
+ showCloseButton: true,
+ ),
+ ),
Expanded(
- child: Column(
- children: [
- _AppBarWithBoundary(
- child: BottomOfTitleBarWidget(
- title: TitleBarTitleWidget(
- title: AppLocalizations.of(context).addMore,
- ),
- caption:
- AppLocalizations.of(context).selectItemsToAdd,
- showCloseButton: true,
- ),
- ),
- Expanded(
- child: DelayedGallery(
- hiddenCollectionIDs: hiddenCollectionIDs,
- selectedFiles: selectedFiles,
- ),
- ),
- ],
+ child: DelayedGallery(
+ hiddenCollectionIDs: hiddenCollectionIDs,
+ selectedFiles: selectedFiles,
+ ),
+ ),
+ ],
+ ),
+ ),
+ SafeArea(
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border(
+ top: BorderSide(
+ color: getEnteColorScheme(context).strokeFaint,
),
),
- SafeArea(
- child: Container(
+ ),
+ child: Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 428),
+ child: Padding(
//inner stroke of 1pt + 15 pts of top padding = 16 pts
padding: const EdgeInsets.fromLTRB(16, 15, 16, 8),
- decoration: BoxDecoration(
- border: Border(
- top: BorderSide(
- color: getEnteColorScheme(context).strokeFaint,
- ),
- ),
- ),
child: Column(
children: [
ValueListenableBuilder(
@@ -164,11 +158,11 @@ class AddPhotosPhotoWidget extends StatelessWidget {
),
),
),
- ],
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
);
}
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 3018559ae8..ec47040fe9 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
@@ -1,5 +1,3 @@
-import "dart:math";
-
import "package:flutter/material.dart";
import "package:modal_bottom_sheet/modal_bottom_sheet.dart";
import "package:photos/core/event_bus.dart";
@@ -58,89 +56,86 @@ class PickCoverPhotoWidget extends StatelessWidget {
});
return Padding(
- padding: const EdgeInsets.all(0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: min(428, MediaQuery.of(context).size.width),
- ),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ child: SizedBox(
+ width: double.infinity,
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Expanded(
child: Column(
- mainAxisSize: MainAxisSize.max,
children: [
+ BottomOfTitleBarWidget(
+ title: TitleBarTitleWidget(
+ title: AppLocalizations.of(context).selectCoverPhoto,
+ ),
+ caption: collection.displayName,
+ showCloseButton: true,
+ ),
Expanded(
- child: Column(
- children: [
- BottomOfTitleBarWidget(
- title: TitleBarTitleWidget(
- title:
- AppLocalizations.of(context).selectCoverPhoto,
- ),
- caption: collection.displayName,
- showCloseButton: true,
- ),
- Expanded(
- child: GalleryFilesState(
- child: Gallery(
- asyncLoader: (
- creationStartTime,
- creationEndTime, {
- limit,
- asc,
- }) async {
- final FileLoadResult result =
- await FilesDB.instance.getFilesInCollection(
- collection.id,
- creationStartTime,
- creationEndTime,
- limit: limit,
- asc: asc,
- );
- // hide ignored files from home page UI
- final ignoredIDs = await IgnoredFilesService
- .instance.idToIgnoreReasonMap;
- result.files.removeWhere(
- (f) =>
- f.uploadedFileID == null &&
- IgnoredFilesService.instance
- .shouldSkipUpload(ignoredIDs, f),
- );
- return result;
- },
- reloadEvent: Bus.instance
- .on<CollectionUpdatedEvent>()
- .where(
- (event) =>
- event.collectionID == collection.id,
- ),
- tagPrefix: "pick_cover_photo_gallery",
- selectedFiles: selectedFiles,
- limitSelectionToOne: true,
- showSelectAll: false,
- sortAsyncFn: () =>
- collection.pubMagicMetadata.asc ?? false,
- disablePinnedGroupHeader: true,
- disableVerticalPaddingForScrollbar: true,
+ child: GalleryFilesState(
+ child: Gallery(
+ asyncLoader: (
+ creationStartTime,
+ creationEndTime, {
+ limit,
+ asc,
+ }) async {
+ final FileLoadResult result =
+ await FilesDB.instance.getFilesInCollection(
+ collection.id,
+ creationStartTime,
+ creationEndTime,
+ limit: limit,
+ asc: asc,
+ );
+ // hide ignored files from home page UI
+ final ignoredIDs = await IgnoredFilesService
+ .instance.idToIgnoreReasonMap;
+ result.files.removeWhere(
+ (f) =>
+ f.uploadedFileID == null &&
+ IgnoredFilesService.instance.shouldSkipUpload(
+ ignoredIDs,
+ f,
+ ),
+ );
+ return result;
+ },
+ reloadEvent: Bus.instance
+ .on<CollectionUpdatedEvent>()
+ .where(
+ (event) => event.collectionID == collection.id,
),
- ),
- ),
- ],
+ tagPrefix: "pick_cover_photo_gallery",
+ selectedFiles: selectedFiles,
+ limitSelectionToOne: true,
+ showSelectAll: false,
+ sortAsyncFn: () =>
+ collection.pubMagicMetadata.asc ?? false,
+ disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
+ ),
),
),
- SafeArea(
- child: Container(
+ ],
+ ),
+ ),
+ SafeArea(
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border(
+ top: BorderSide(
+ color: getEnteColorScheme(context).strokeFaint,
+ ),
+ ),
+ ),
+ child: Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 428),
+ child: Padding(
//inner stroke of 1pt + 15 pts of top padding = 16 pts
padding: const EdgeInsets.fromLTRB(16, 15, 16, 8),
- decoration: BoxDecoration(
- border: Border(
- top: BorderSide(
- color: getEnteColorScheme(context).strokeFaint,
- ),
- ),
- ),
child: Column(
children: [
ValueListenableBuilder(
@@ -190,11 +185,11 @@ class PickCoverPhotoWidget extends StatelessWidget {
),
),
),
- ],
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
);
}
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 756a77908b..049dcfcb28 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
@@ -1,5 +1,3 @@
-import "dart:math";
-
import "package:flutter/material.dart";
import "package:modal_bottom_sheet/modal_bottom_sheet.dart";
import "package:photos/core/event_bus.dart";
@@ -67,73 +65,68 @@ class PickPersonCoverPhotoWidget extends StatelessWidget {
});
return Padding(
- padding: const EdgeInsets.all(0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: min(428, MediaQuery.of(context).size.width),
- ),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ child: SizedBox(
+ width: double.infinity,
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Expanded(
child: Column(
- mainAxisSize: MainAxisSize.max,
children: [
+ BottomOfTitleBarWidget(
+ title: TitleBarTitleWidget(
+ title: AppLocalizations.of(context).selectCoverPhoto,
+ ),
+ caption: personEntity.data.name,
+ showCloseButton: true,
+ ),
Expanded(
- child: Column(
- children: [
- BottomOfTitleBarWidget(
- title: TitleBarTitleWidget(
- title:
- AppLocalizations.of(context).selectCoverPhoto,
- ),
- caption: personEntity.data.name,
- showCloseButton: true,
- ),
- Expanded(
- child: GalleryFilesState(
- child: Gallery(
- asyncLoader: (
- creationStartTime,
- creationEndTime, {
- limit,
- asc,
- }) async {
- final FileLoadResult result =
- await loadPersonFiles();
+ child: GalleryFilesState(
+ child: Gallery(
+ asyncLoader: (
+ creationStartTime,
+ creationEndTime, {
+ limit,
+ asc,
+ }) async {
+ final FileLoadResult result = await loadPersonFiles();
- return result;
- },
- // reloadEvent: Bus.instance
- // .on<CollectionUpdatedEvent>()
- // .where(
- // (event) =>
- // event.collectionID == collection.id,
- // ),
- tagPrefix: "pick_center_point_gallery",
- selectedFiles: selectedFiles,
- limitSelectionToOne: true,
- showSelectAll: false,
- disablePinnedGroupHeader: true,
- disableVerticalPaddingForScrollbar: true,
- ),
- ),
- ),
- ],
+ return result;
+ },
+ // reloadEvent: Bus.instance
+ // .on<CollectionUpdatedEvent>()
+ // .where(
+ // (event) =>
+ // event.collectionID == collection.id,
+ // ),
+ tagPrefix: "pick_center_point_gallery",
+ selectedFiles: selectedFiles,
+ limitSelectionToOne: true,
+ showSelectAll: false,
+ disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
+ ),
),
),
- SafeArea(
- child: Container(
+ ],
+ ),
+ ),
+ SafeArea(
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border(
+ top: BorderSide(
+ color: getEnteColorScheme(context).strokeFaint,
+ ),
+ ),
+ ),
+ child: Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 428),
+ child: Padding(
//inner stroke of 1pt + 15 pts of top padding = 16 pts
padding: const EdgeInsets.fromLTRB(16, 15, 16, 8),
- decoration: BoxDecoration(
- border: Border(
- top: BorderSide(
- color: getEnteColorScheme(context).strokeFaint,
- ),
- ),
- ),
child: ValueListenableBuilder(
valueListenable: isFileSelected,
builder: (context, bool value, _) {
@@ -168,11 +161,11 @@ class PickPersonCoverPhotoWidget extends StatelessWidget {
),
),
),
- ],
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
);
}
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 062d2e384b..61d45a3bdc 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
@@ -1,5 +1,3 @@
-import "dart:math";
-
import "package:flutter/material.dart";
import "package:modal_bottom_sheet/modal_bottom_sheet.dart";
import "package:photos/core/constants.dart";
@@ -61,89 +59,82 @@ class PickCenterPointWidget extends StatelessWidget {
});
return Padding(
- padding: const EdgeInsets.all(0),
- child: Row(
- mainAxisAlignment: MainAxisAlignment.center,
- children: [
- ConstrainedBox(
- constraints: BoxConstraints(
- maxWidth: min(428, MediaQuery.of(context).size.width),
- ),
- child: Padding(
- padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ padding: const EdgeInsets.fromLTRB(0, 32, 0, 8),
+ child: SizedBox(
+ width: double.infinity,
+ child: Column(
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Expanded(
child: Column(
- mainAxisSize: MainAxisSize.max,
children: [
+ BottomOfTitleBarWidget(
+ title: TitleBarTitleWidget(
+ title: AppLocalizations.of(context).pickCenterPoint,
+ ),
+ caption: locationTagName ??
+ AppLocalizations.of(context).newLocation,
+ showCloseButton: true,
+ ),
Expanded(
- child: Column(
- children: [
- BottomOfTitleBarWidget(
- title: TitleBarTitleWidget(
- title: AppLocalizations.of(context).pickCenterPoint,
- ),
- caption: locationTagName ??
- AppLocalizations.of(context).newLocation,
- showCloseButton: true,
- ),
- Expanded(
- child: GalleryFilesState(
- child: Gallery(
- asyncLoader: (
- creationStartTime,
- creationEndTime, {
- limit,
- asc,
- }) async {
- final collectionsToHide = CollectionsService
- .instance
- .archivedOrHiddenCollectionIds();
- FileLoadResult result;
- result = await FilesDB.instance
- .fetchAllUploadedAndSharedFilesWithLocation(
- galleryLoadStartTime,
- galleryLoadEndTime,
- limit: null,
- asc: false,
- filterOptions: DBFilterOptions(
- ignoredCollectionIDs: collectionsToHide,
- hideIgnoredForUpload: true,
- ),
- );
- return result;
- },
- reloadEvent:
- Bus.instance.on<LocalPhotosUpdatedEvent>(),
- tagPrefix: "pick_center_point_gallery",
- selectedFiles: selectedFiles,
- limitSelectionToOne: true,
- showSelectAll: false,
- header: Padding(
- padding: const EdgeInsets.all(10),
- child: NotificationTipWidget(
- AppLocalizations.of(
- context,
- ).locationPickerTip,
- ),
- ),
- disablePinnedGroupHeader: true,
- disableVerticalPaddingForScrollbar: true,
+ child: GalleryFilesState(
+ child: Gallery(
+ asyncLoader: (
+ creationStartTime,
+ creationEndTime, {
+ limit,
+ asc,
+ }) async {
+ final collectionsToHide = CollectionsService.instance
+ .archivedOrHiddenCollectionIds();
+ FileLoadResult result;
+ result = await FilesDB.instance
+ .fetchAllUploadedAndSharedFilesWithLocation(
+ galleryLoadStartTime,
+ galleryLoadEndTime,
+ limit: null,
+ asc: false,
+ filterOptions: DBFilterOptions(
+ ignoredCollectionIDs: collectionsToHide,
+ hideIgnoredForUpload: true,
),
+ );
+ return result;
+ },
+ reloadEvent: Bus.instance.on<LocalPhotosUpdatedEvent>(),
+ tagPrefix: "pick_center_point_gallery",
+ selectedFiles: selectedFiles,
+ limitSelectionToOne: true,
+ showSelectAll: false,
+ header: Padding(
+ padding: const EdgeInsets.all(10),
+ child: NotificationTipWidget(
+ AppLocalizations.of(context).locationPickerTip,
),
),
- ],
+ disablePinnedGroupHeader: true,
+ disableVerticalPaddingForScrollbar: true,
+ ),
),
),
- SafeArea(
- child: Container(
+ ],
+ ),
+ ),
+ SafeArea(
+ child: Container(
+ decoration: BoxDecoration(
+ border: Border(
+ top: BorderSide(
+ color: getEnteColorScheme(context).strokeFaint,
+ ),
+ ),
+ ),
+ child: Center(
+ child: ConstrainedBox(
+ constraints: const BoxConstraints(maxWidth: 428),
+ child: Padding(
//inner stroke of 1pt + 15 pts of top padding = 16 pts
padding: const EdgeInsets.fromLTRB(16, 15, 16, 8),
- decoration: BoxDecoration(
- border: Border(
- top: BorderSide(
- color: getEnteColorScheme(context).strokeFaint,
- ),
- ),
- ),
child: ValueListenableBuilder(
valueListenable: isFileSelected,
builder: (context, bool value, _) {
@@ -168,11 +159,11 @@ class PickCenterPointWidget extends StatelessWidget {
),
),
),
- ],
+ ),
),
),
- ),
- ],
+ ],
+ ),
),
);
}