From b8ee9fafd1603811ca87b31334115e73e8821d96 Mon Sep 17 00:00:00 2001 From: laurenspriem Date: Thu, 28 Aug 2025 17:03:24 +0530 Subject: [PATCH] Better confirmation dialog --- .../photos/assets/ducky_cleaning_static.svg | 52 ++++++++++++++ .../lib/ui/tools/similar_images_page.dart | 69 ++++++++++--------- 2 files changed, 89 insertions(+), 32 deletions(-) create mode 100644 mobile/apps/photos/assets/ducky_cleaning_static.svg diff --git a/mobile/apps/photos/assets/ducky_cleaning_static.svg b/mobile/apps/photos/assets/ducky_cleaning_static.svg new file mode 100644 index 0000000000..5876502d83 --- /dev/null +++ b/mobile/apps/photos/assets/ducky_cleaning_static.svg @@ -0,0 +1,52 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart index 71d07fa993..8a44aa610d 100644 --- a/mobile/apps/photos/lib/ui/tools/similar_images_page.dart +++ b/mobile/apps/photos/lib/ui/tools/similar_images_page.dart @@ -1021,9 +1021,10 @@ class _SimilarImagesPageState extends State { } } - void _showCongratulationsDialog(int deletedCount, int totalSize) { + void _showCongratulationsDialog(int totalSize) { final textTheme = getEnteTextTheme(context); final colorScheme = getEnteColorScheme(context); + final screenWidth = MediaQuery.of(context).size.width; showDialog( context: context, @@ -1033,39 +1034,43 @@ class _SimilarImagesPageState extends State { shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(8), ), - content: Column( - mainAxisSize: MainAxisSize.min, - children: [ - Icon( - Icons.celebration_outlined, - size: 48, - color: colorScheme.primary500, - ), - const SizedBox(height: 16), - Text( - AppLocalizations.of(context).greatJob, - style: textTheme.h3Bold, - textAlign: TextAlign.center, - ), - const SizedBox(height: 8), - Text( - AppLocalizations.of(context).cleanedUpSimilarImages( - count: deletedCount, - size: formatBytes(totalSize), + contentPadding: const EdgeInsets.all(24), + content: SizedBox( + width: screenWidth - (crossAxisSpacing), + child: Column( + mainAxisSize: MainAxisSize.min, + children: [ + SvgPicture.asset( + "assets/ducky_cleaning_static.svg", + height: 160, ), - style: textTheme.body, - textAlign: TextAlign.center, - ), - const SizedBox(height: 24), - SizedBox( - width: double.infinity, - child: ButtonWidget( - labelText: AppLocalizations.of(context).done, - buttonType: ButtonType.primary, - onTap: () async => Navigator.of(context).pop(), + const SizedBox(height: 16), + Text( + AppLocalizations.of(context).hoorayyyy, + style: textTheme.h2Bold.copyWith( + color: colorScheme.primary500, + ), + textAlign: TextAlign.center, ), - ), - ], + const SizedBox(height: 8), + Text( + AppLocalizations.of(context).cleanedUpSimilarImages( + size: formatBytes(totalSize), + ), + style: textTheme.body, + textAlign: TextAlign.center, + ), + const SizedBox(height: 36), + SizedBox( + width: double.infinity, + child: ButtonWidget( + labelText: AppLocalizations.of(context).done, + buttonType: ButtonType.primary, + onTap: () async => Navigator.of(context).pop(), + ), + ), + ], + ), ), ), );