π End-to-end encrypted cloud for everything.
Dart 2faandroidauthye2eeencryptionend-to-end-encryptionfluttergolanggoogle-photosgoogle-photos-alternativeiosopensourcephotosprivacyprivacy-toolstypescriptzero-knowledge
[mobile][photos] Align action sheet icons and typography
r4khul5b9a95c15e90
diff --git a/mobile/apps/photos/changes/action-sheet-polish.md b/mobile/apps/photos/changes/action-sheet-polish.mdnew file mode 100644index 0000000000..cae7cfc885--- /dev/null+++ b/mobile/apps/photos/changes/action-sheet-polish.md@@ -0,0 +1 @@+- Improved action sheet legibility with consistent icons and text.diff --git a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_sheet.dart b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_sheet.dartindex 8a73e90fe9..523dcf59c3 100644--- a/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_sheet.dart+++ b/mobile/apps/photos/lib/ui/components/bottom_action_bar/selection_action_sheet.dart@@ -173,10 +173,10 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {final gridRowSpacing = isLandscape ? Spacing.sm : Spacing.md;final colors = context.componentColors;final sheetColor = widget.backgroundColor ?? colors.fillLight;- final miniHeight =- media.textScaler.scale(TextStyles.mini.fontSize!) *- TextStyles.mini.height!;- final rowHeight = math.max(48.0, miniHeight * 2 + Spacing.lg);+ final labelLineHeight =+ media.textScaler.scale(TextStyles.body.fontSize!) *+ TextStyles.body.height!;+ final rowHeight = math.max(48.0, labelLineHeight * 2 + Spacing.lg);final controlsHeight = math.max(44.0,media.textScaler.scale(TextStyles.body.fontSize!) *@@ -196,8 +196,8 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {);final minTileWidth =64 *- media.textScaler.scale(TextStyles.mini.fontSize!) /- TextStyles.mini.fontSize!;+ media.textScaler.scale(TextStyles.body.fontSize!) /+ TextStyles.body.fontSize!;final gridWidth = sheetWidth - Spacing.md * 2;final availableColumns =isLandscape &&@@ -212,10 +212,10 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {final labelWidth =(sheetWidth - Spacing.md * 2 - Spacing.xs * (columns - 1)) /columns;- var labelHeight = miniHeight;+ var labelHeight = labelLineHeight;for (final action in grid) {final painter = TextPainter(- text: TextSpan(text: action.labelText, style: TextStyles.mini),+ text: TextSpan(text: action.labelText, style: TextStyles.body),textDirection: Directionality.of(context),textScaler: media.textScaler,maxLines: 2,@@ -226,7 +226,7 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {}final tileHeight = math.max(64.0,- IconSizes.small + Spacing.sm * 2 + Spacing.xs * 3 + labelHeight,+ _SheetAction.iconSize + Spacing.sm * 2 + Spacing.xs * 3 + labelHeight,);final gridHeight =gridRows * tileHeight + (gridRows - 1) * gridRowSpacing;@@ -293,7 +293,9 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {? const Duration(milliseconds: 1): _duration,builder: (context, scrollController) {- _actionsController = scrollController;+ _actionsController = _minExtent == _maxExtent+ ? null+ : scrollController;return Column(children: [SizedBox(@@ -311,7 +313,8 @@ class _SelectionActionSheetState extends State<SelectionActionSheet> {child: SafeArea(top: false,child: CustomScrollView(- controller: scrollController,+ controller: _actionsController,+ primary: false,slivers: [SliverPersistentHeader(pinned: true,@@ -486,6 +489,8 @@ class _SheetHandle extends SliverPersistentHeaderDelegate {}class _SheetAction extends StatelessWidget {+ static const iconSize = 22.0;+const _SheetAction({required this.action,required this.height,@@ -500,22 +505,20 @@ class _SheetAction extends StatelessWidget {@overrideWidget build(BuildContext context) {final colors = context.componentColors;- final iconColor = action.onTap == null+ final foregroundColor = action.onTap == null? colors.textLightest: action.isCritical? colors.warning- : colors.textLight;- final textColor = action.onTap != null && isRow && !action.isCritical- ? colors.textBase- : iconColor;+ : colors.textBase;final icon = action.hugeIcon != null? HugeIcon(icon: action.hugeIcon!,- size: IconSizes.small,- color: iconColor,+ size: iconSize,+ strokeWidth: 1.5 * 24 / iconSize,+ color: foregroundColor,): IconTheme.merge(- data: IconThemeData(size: IconSizes.small, color: iconColor),+ data: IconThemeData(size: iconSize, color: foregroundColor),child: action.iconWidget!,);final label = Text(@@ -523,7 +526,7 @@ class _SheetAction extends StatelessWidget {maxLines: 2,overflow: TextOverflow.ellipsis,textAlign: isRow ? TextAlign.start : TextAlign.center,- style: TextStyles.mini.copyWith(color: textColor),+ style: TextStyles.body.copyWith(color: foregroundColor),);return Semantics(button: true,diff --git a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dartindex be00248a02..58ba7e6f81 100644--- a/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/actions/file_selection_actions_widget.dart@@ -1,5 +1,4 @@import "dart:async";-import "dart:io";import "package:ente_pure_utils/ente_pure_utils.dart";import "package:ente_strings/ente_strings.dart";@@ -221,9 +220,7 @@ class _FileSelectionActionsWidgetStateSelectionSheetAction(labelText: context.strings.share,gridOrder: 0,- hugeIcon: Platform.isIOS- ? HugeIcons.strokeRoundedShare03- : HugeIcons.strokeRoundedShare08,+ hugeIcon: HugeIcons.strokeRoundedShare08,key: shareButtonKey,onTap: _shareSelectedFiles,),@@ -293,7 +290,7 @@ class _FileSelectionActionsWidgetStateif (widget.type.showMoveToAlbum()) {items.add(SelectionSheetAction(- hugeIcon: HugeIcons.strokeRoundedArrowRight01,+ hugeIcon: HugeIcons.strokeRoundedImageUpload,labelText: context.strings.moveToAlbum,onTap: anyUploadedFiles ? _moveFiles : null,shouldShow: ownedFilesCount > 0,@@ -304,7 +301,7 @@ class _FileSelectionActionsWidgetStateif (widget.type.showMovetoHiddenAlbum()) {items.add(SelectionSheetAction(- hugeIcon: HugeIcons.strokeRoundedArrowRight01,+ hugeIcon: HugeIcons.strokeRoundedImageUpload,labelText: context.strings.moveToAlbum,onTap: _moveFilesToHiddenAlbum,),@@ -314,7 +311,7 @@ class _FileSelectionActionsWidgetStateif (widget.type.showRemoveFromAlbum()) {items.add(SelectionSheetAction(- hugeIcon: HugeIcons.strokeRoundedRemove01,+ hugeIcon: HugeIcons.strokeRoundedImageDelete01,labelText: context.strings.removeFromAlbum,onTap: removeCount > 0 ? _removeFilesFromAlbum : null,shouldShow: removeCount > 0,@@ -325,7 +322,7 @@ class _FileSelectionActionsWidgetStateif (widget.type.showRemoveFromHiddenAlbum()) {items.add(SelectionSheetAction(- hugeIcon: HugeIcons.strokeRoundedRemove01,+ hugeIcon: HugeIcons.strokeRoundedImageDelete01,labelText: context.strings.removeFromAlbum,onTap: _removeFilesFromHiddenAlbum,),@@ -381,7 +378,7 @@ class _FileSelectionActionsWidgetStateSelectionSheetAction(labelText: context.strings.download,gridOrder: 7,- hugeIcon: HugeIcons.strokeRoundedDownload01,+ hugeIcon: HugeIcons.strokeRoundedDownload04,onTap: () => _download(widget.selectedFiles.files.toList()),),);diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dartindex 18b3ccc91a..c58f38ddb4 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/gallery_app_bar_widget.dart@@ -848,8 +848,10 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {_menuOption(AlbumPopupAction.editDetails,strings.editDetails,- const HugeIcon(- icon: HugeIcons.strokeRoundedEdit03,+ HugeIcon(+ icon: onCover+ ? HugeIcons.strokeRoundedEdit02+ : HugeIcons.strokeRoundedEdit03,size: IconSizes.small,),),@@ -929,8 +931,12 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {isArchived ? strings.unarchive : strings.archive,HugeIcon(icon: isArchived- ? HugeIcons.strokeRoundedUnarchive03- : HugeIcons.strokeRoundedArchive03,+ ? (onCover+ ? HugeIcons.strokeRoundedInboxUpload+ : HugeIcons.strokeRoundedUnarchive03)+ : (onCover+ ? HugeIcons.strokeRoundedInboxDownload+ : HugeIcons.strokeRoundedArchive03),size: IconSizes.small,),),@@ -941,7 +947,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {HugeIcon(icon: isHidden? HugeIcons.strokeRoundedView- : HugeIcons.strokeRoundedViewOffSlash,+ : (onCover+ ? HugeIcons.strokeRoundedViewOff+ : HugeIcons.strokeRoundedViewOffSlash),size: IconSizes.small,),),@@ -964,8 +972,12 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {: strings.archive,HugeIcon(icon: widget.collection!.hasShareeArchived()- ? HugeIcons.strokeRoundedUnarchive03- : HugeIcons.strokeRoundedArchive03,+ ? (onCover+ ? HugeIcons.strokeRoundedInboxUpload+ : HugeIcons.strokeRoundedUnarchive03)+ : (onCover+ ? HugeIcons.strokeRoundedInboxDownload+ : HugeIcons.strokeRoundedArchive03),size: IconSizes.small,),),@@ -976,7 +988,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {HugeIcon(icon: widget.collection!.hasShareeHidden()? HugeIcons.strokeRoundedView- : HugeIcons.strokeRoundedViewOffSlash,+ : (onCover+ ? HugeIcons.strokeRoundedViewOff+ : HugeIcons.strokeRoundedViewOffSlash),size: IconSizes.small,),),@@ -998,7 +1012,9 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {!flagService.enableMultiCast &&castService.getActiveSessions().isNotEmpty? HugeIcons.strokeRoundedTvSmart- : HugeIcons.strokeRoundedTv02,+ : (onCover+ ? HugeIcons.strokeRoundedAirplayLine+ : HugeIcons.strokeRoundedTv02),size: IconSizes.small,),),@@ -1059,8 +1075,10 @@ class _GalleryAppBarWidgetState extends State<GalleryAppBarWidget> {_menuOption(AlbumPopupAction.downloadAlbum,strings.download,- const HugeIcon(- icon: HugeIcons.strokeRoundedDownload01,+ HugeIcon(+ icon: onCover+ ? HugeIcons.strokeRoundedDownload04+ : HugeIcons.strokeRoundedDownload01,size: IconSizes.small,),),diff --git a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/album_actions_sheet.dart b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/album_actions_sheet.dartindex 377f872c6b..12bef574d2 100644--- a/mobile/apps/photos/lib/ui/viewer/gallery/hooks/album_actions_sheet.dart+++ b/mobile/apps/photos/lib/ui/viewer/gallery/hooks/album_actions_sheet.dart@@ -3,6 +3,7 @@ import "dart:math" as math;import "package:ente_components/ente_components.dart";import "package:flutter/gestures.dart";import "package:flutter/material.dart";+import "package:hugeicons/hugeicons.dart";Future<T?> showAlbumActionsSheet<T>(BuildContext context,@@ -35,8 +36,8 @@ Future<T?> showAlbumActionsSheet<T>(final gridWidth = constraints.maxWidth - Spacing.md * 2;final minTileWidth =64 *- media.textScaler.scale(TextStyles.mini.fontSize!) /- TextStyles.mini.fontSize!;+ media.textScaler.scale(TextStyles.body.fontSize!) /+ TextStyles.body.fontSize!;final columns = gridWidth >= minTileWidth * 4 + Spacing.xs * 3? 4: 2;@@ -236,7 +237,7 @@ class _AlbumActionTile<T> extends StatelessWidget {@overrideWidget build(BuildContext context) {final colors = context.componentColors;- final foreground = option.labelColor ?? colors.textLight;+ final foreground = option.labelColor ?? colors.textBase;return Semantics(button: true,child: InkWell(@@ -250,25 +251,14 @@ class _AlbumActionTile<T> extends StatelessWidget {mainAxisSize: MainAxisSize.min,mainAxisAlignment: MainAxisAlignment.start,children: [- SizedBox.square(- dimension: 34,- child: Center(- child: IconTheme.merge(- data: IconThemeData(- color: foreground,- size: IconSizes.small,- ),- child: option.leadingWidget ?? const SizedBox.shrink(),- ),- ),- ),+ _buildActionIcon(option.leadingWidget, foreground),const SizedBox(height: Spacing.xs),Text(option.label,maxLines: 2,overflow: TextOverflow.ellipsis,textAlign: TextAlign.center,- style: TextStyles.mini.copyWith(color: foreground),+ style: TextStyles.body.copyWith(color: foreground),),],),@@ -301,24 +291,16 @@ class _AlbumActionRow<T> extends StatelessWidget {child: Row(spacing: Spacing.md,children: [- SizedBox.square(- dimension: 34,- child: Center(- child: IconTheme.merge(- data: IconThemeData(- color: option.labelColor ?? colors.textLight,- size: IconSizes.small,- ),- child: option.leadingWidget ?? const SizedBox.shrink(),- ),- ),+ _buildActionIcon(+ option.leadingWidget,+ option.labelColor ?? colors.textBase,),Expanded(child: Text(option.label,maxLines: 1,overflow: TextOverflow.ellipsis,- style: TextStyles.mini.copyWith(+ style: TextStyles.body.copyWith(color: option.labelColor ?? colors.textBase,),),@@ -332,4 +314,26 @@ class _AlbumActionRow<T> extends StatelessWidget {}}+Widget _buildActionIcon(Widget? icon, Color color) {+ const iconSize = 22.0;+ return SizedBox.square(+ dimension: 34,+ child: Center(+ child: icon is HugeIcon+ ? HugeIcon(+ key: icon.key,+ icon: icon.icon,+ color: color,+ secondaryColor: icon.secondaryColor,+ size: iconSize,+ strokeWidth: 1.5 * 24 / iconSize,+ )+ : IconTheme.merge(+ data: IconThemeData(color: color, size: iconSize),+ child: icon ?? const SizedBox.shrink(),+ ),+ ),+ );+}+const _maxHeightFraction = 0.8;diff --git a/mobile/apps/photos/test/ui/viewer/gallery/selection_action_sheet_test.dart b/mobile/apps/photos/test/ui/viewer/gallery/selection_action_sheet_test.dartindex e75879f4c6..7f31e969aa 100644--- a/mobile/apps/photos/test/ui/viewer/gallery/selection_action_sheet_test.dart+++ b/mobile/apps/photos/test/ui/viewer/gallery/selection_action_sheet_test.dart@@ -81,7 +81,9 @@ void main() {);controller ??= sheet.controller;expect(sheet.controller, same(controller));- sheet.controller!.jumpTo(sheet.maxChildSize);+ if (sheet.controller!.isAttached) {+ sheet.controller!.jumpTo(sheet.maxChildSize);+ }final scrollable = find.descendant(of: find.byType(CustomScrollView),matching: find.byType(Scrollable),