From 288adb2e7c3fcfea0ed7c55b9c5257c69429eded Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Thu, 16 May 2024 18:48:46 +0530 Subject: [PATCH] [mob][photos] Make faces loading in file info less ugly --- mobile/lib/ui/components/info_item_widget.dart | 9 ++++++--- mobile/lib/ui/viewer/file_details/faces_item_widget.dart | 5 +++++ 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mobile/lib/ui/components/info_item_widget.dart b/mobile/lib/ui/components/info_item_widget.dart index 5bec95ccf..73517e052 100644 --- a/mobile/lib/ui/components/info_item_widget.dart +++ b/mobile/lib/ui/components/info_item_widget.dart @@ -11,6 +11,7 @@ class InfoItemWidget extends StatelessWidget { final Widget? endSection; final Future> subtitleSection; final bool hasChipButtons; + final bool biggerSpinner; final VoidCallback? onTap; const InfoItemWidget({ required this.leadingIcon, @@ -19,6 +20,7 @@ class InfoItemWidget extends StatelessWidget { this.endSection, required this.subtitleSection, this.hasChipButtons = false, + this.biggerSpinner = false, this.onTap, super.key, }); @@ -57,10 +59,11 @@ class InfoItemWidget extends StatelessWidget { } } else { child = EnteLoadingWidget( - padding: 3, - size: 11, + padding: biggerSpinner ? 6 : 3, + size: biggerSpinner ? 20 : 11, color: getEnteColorScheme(context).strokeMuted, - alignment: Alignment.centerLeft, + alignment: + biggerSpinner ? Alignment.center : Alignment.centerLeft, ); } return AnimatedSwitcher( diff --git a/mobile/lib/ui/viewer/file_details/faces_item_widget.dart b/mobile/lib/ui/viewer/file_details/faces_item_widget.dart index e36089749..5df5e6655 100644 --- a/mobile/lib/ui/viewer/file_details/faces_item_widget.dart +++ b/mobile/lib/ui/viewer/file_details/faces_item_widget.dart @@ -40,6 +40,7 @@ class _FacesItemWidgetState extends State { leadingIcon: Icons.face_retouching_natural_outlined, subtitleSection: _faceWidgets(context, widget.file, editMode), hasChipButtons: true, + biggerSpinner: true, editOnTap: _toggleEditMode, ); } @@ -140,6 +141,10 @@ class _FacesItemWidgetState extends State { final lastViewedClusterID = ClusterFeedbackService.lastViewedClusterID; final faceWidgets = []; + + // await generation of the face crops here, so that the file info shows one central loading spinner + final test = await getRelevantFaceCrops(faces); + final faceCrops = getRelevantFaceCrops(faces); for (final Face face in faces) { final int? clusterID = faceIdsToClusterIds[face.faceID];