Skip to content

armgit / ente

Public Imported from GitHub
0

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

[mob][photos] Improve album sharing selection and empty states (#13271)

aman-pilot8f2b2c10fd5a
diff --git a/mobile/apps/photos/assets/2.0x/empty_album_sharing.png b/mobile/apps/photos/assets/2.0x/empty_album_sharing.png
new file mode 100644
index 0000000000..6bc98399fa
Binary files /dev/null and b/mobile/apps/photos/assets/2.0x/empty_album_sharing.png differ
diff --git a/mobile/apps/photos/assets/3.0x/empty_album_sharing.png b/mobile/apps/photos/assets/3.0x/empty_album_sharing.png
new file mode 100644
index 0000000000..aad8b41b1a
Binary files /dev/null and b/mobile/apps/photos/assets/3.0x/empty_album_sharing.png differ
diff --git a/mobile/apps/photos/assets/empty_album_sharing.png b/mobile/apps/photos/assets/empty_album_sharing.png
new file mode 100644
index 0000000000..3c9da3d1fb
Binary files /dev/null and b/mobile/apps/photos/assets/empty_album_sharing.png differ
diff --git a/mobile/apps/photos/changes/album-sharing-selection.md b/mobile/apps/photos/changes/album-sharing-selection.md
new file mode 100644
index 0000000000..c7d43501a2
--- /dev/null
+++ b/mobile/apps/photos/changes/album-sharing-selection.md
@@ -0,0 +1 @@
+- Improved album sharing suggestions and empty states, and fixed recipient removal while animations finish.
diff --git a/mobile/apps/photos/lib/ui/sharing/add_people_sheet.dart b/mobile/apps/photos/lib/ui/sharing/add_people_sheet.dart
index f1d8d1c3b4..81386566d4 100644
--- a/mobile/apps/photos/lib/ui/sharing/add_people_sheet.dart
+++ b/mobile/apps/photos/lib/ui/sharing/add_people_sheet.dart
@@ -106,6 +106,7 @@ class _AddPeopleSheetState extends State<_AddPeopleSheet> {
final _contactsScrollController = ScrollController();
final _shareLinkKey = GlobalKey();
late final List<UserSuggestion> _contacts;
+ String _emailText = "";
bool _emailIsValid = false;
bool _emailHasNoAccount = false;
@@ -134,10 +135,14 @@ class _AddPeopleSheetState extends State<_AddPeopleSheet> {
for (final suggestion in widget.selected)
normalizedSharingEmail(suggestion.email),
};
+ final query = _emailHasNoAccount
+ ? ""
+ : _textController.text.trim().toLowerCase();
final availableContacts = _contacts
.where(
(contact) =>
- !selectedEmails.contains(normalizedSharingEmail(contact.email)),
+ !selectedEmails.contains(normalizedSharingEmail(contact.email)) &&
+ matchesResolvedSuggestionQuery(contact, query),
)
.toList();
final keyboardVisible = MediaQuery.viewInsetsOf(context).bottom > 0;
@@ -151,44 +156,53 @@ class _AddPeopleSheetState extends State<_AddPeopleSheet> {
isKeyboardAware: true,
content: Flexible(
fit: FlexFit.loose,
- child: Column(
- mainAxisSize: MainAxisSize.min,
- crossAxisAlignment: CrossAxisAlignment.start,
- children: [
- SelectedRecipientChips(
- suggestions: widget.selected,
- scrollController: _selectedPeopleScrollController,
- onRemove: _toggleSuggestion,
- onLongPress: (suggestion) => showVerifyIdentitySheet(
- context,
- self: false,
- email: suggestion.email,
+ child: SingleChildScrollView(
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ SelectedRecipientChips(
+ suggestions: widget.selected,
+ scrollController: _selectedPeopleScrollController,
+ onRemove: _toggleSuggestion,
+ onLongPress: (suggestion) => showVerifyIdentitySheet(
+ context,
+ self: false,
+ email: suggestion.email,
+ ),
),
- ),
- _EmailField(
- controller: _textController,
- focusNode: _focusNode,
- emailIsValid: _emailIsValid,
- emailHasNoAccount: _emailHasNoAccount,
- shareKey: _shareLinkKey,
- onChanged: (value) {
- setState(() {
- _emailIsValid = EmailValidator.validate(value.trim());
- _emailHasNoAccount = false;
- });
- },
- onSubmit: _tryAddTypedEmail,
- onShareLink: _sharePublicLink,
- ),
- if (!_emailHasNoAccount && availableContacts.isNotEmpty) ...[
- const SizedBox(height: Spacing.xl),
- _ContactSuggestions(
- contacts: availableContacts,
- scrollController: _contactsScrollController,
- onToggle: _toggleSuggestion,
+ _EmailField(
+ controller: _textController,
+ focusNode: _focusNode,
+ emailIsValid: _emailIsValid,
+ emailHasNoAccount: _emailHasNoAccount,
+ shareKey: _shareLinkKey,
+ onChanged: (value) {
+ if (value == _emailText) {
+ return;
+ }
+ _emailText = value;
+ if (_contactsScrollController.hasClients) {
+ _contactsScrollController.jumpTo(0);
+ }
+ setState(() {
+ _emailIsValid = EmailValidator.validate(value.trim());
+ _emailHasNoAccount = false;
+ });
+ },
+ onSubmit: _tryAddTypedEmail,
+ onShareLink: _sharePublicLink,
),
+ if (availableContacts.isNotEmpty) ...[
+ const SizedBox(height: Spacing.xl),
+ _ContactSuggestions(
+ contacts: availableContacts,
+ scrollController: _contactsScrollController,
+ onToggle: _toggleSuggestion,
+ ),
+ ],
],
- ],
+ ),
),
),
actions: keyboardVisible && !_emailHasNoAccount
@@ -297,6 +311,7 @@ class _AddPeopleSheetState extends State<_AddPeopleSheet> {
}
});
if (added) {
+ _clearEmail();
_scrollSelectedPeopleToEnd();
}
}
@@ -394,7 +409,7 @@ class _EmailField extends StatelessWidget {
@override
Widget build(BuildContext context) {
final messageStyle = TextStyles.mini.copyWith(
- color: context.componentColors.textLight,
+ color: context.componentColors.textLighter,
);
return Column(
crossAxisAlignment: CrossAxisAlignment.start,
@@ -443,35 +458,28 @@ class _EmailField extends StatelessWidget {
const SizedBox(height: Spacing.sm),
SizedBox(
width: double.infinity,
- child: Wrap(
- alignment: WrapAlignment.center,
- children: [
- Text(
- '${context.strings.noEnteAccountWithThisEmail} ',
- style: messageStyle,
- ),
- InkWell(
- key: shareKey,
- onTap: () => onShareLink(),
- child: Text(
- context.strings.shareALinkInline,
- style: messageStyle.copyWith(
- color: context.componentColors.textBase,
- decoration: TextDecoration.underline,
- decorationColor: context.componentColors.textBase,
- ),
- ),
- ),
- ],
+ child: Text(
+ context.strings.noEnteAccountWithThisEmail,
+ textAlign: TextAlign.center,
+ style: messageStyle,
),
),
+ const SizedBox(height: Spacing.xl),
+ ButtonComponent(
+ key: shareKey,
+ label: context.strings.shareALink,
+ variant: ButtonComponentVariant.secondary,
+ size: ButtonComponentSize.large,
+ shouldShowSuccessState: false,
+ onTap: onShareLink,
+ ),
],
],
);
}
}
-class _ContactSuggestions extends StatelessWidget {
+class _ContactSuggestions extends StatefulWidget {
const _ContactSuggestions({
required this.contacts,
required this.scrollController,
@@ -481,8 +489,9 @@ class _ContactSuggestions extends StatelessWidget {
static double rowExtent(BuildContext context) {
const textStyle = TextStyles.mini;
final lineExtent =
- MediaQuery.textScalerOf(context).scale(textStyle.fontSize!) *
- textStyle.height!;
+ (MediaQuery.textScalerOf(context).scale(textStyle.fontSize!) *
+ textStyle.height!)
+ .ceilToDouble();
return math.max(
104.0,
getAvatarSize(AvatarType.huge) + Spacing.sm + lineExtent * 2,
@@ -493,6 +502,14 @@ class _ContactSuggestions extends StatelessWidget {
final ScrollController scrollController;
final ValueChanged<UserSuggestion> onToggle;
+ @override
+ State<_ContactSuggestions> createState() => _ContactSuggestionsState();
+}
+
+class _ContactSuggestionsState extends State<_ContactSuggestions> {
+ bool _canScrollBack = false;
+ bool _canScrollForward = false;
+
@override
Widget build(BuildContext context) {
final rowExtent = _ContactSuggestions.rowExtent(context);
@@ -503,108 +520,136 @@ class _ContactSuggestions extends StatelessWidget {
return SizedBox(
height: rowExtent,
- child: Stack(
- children: [
- Positioned.fill(
- child: ShaderMask(
- blendMode: BlendMode.dstIn,
- shaderCallback: (bounds) {
- final fadeStop = (arrowSize / bounds.width).clamp(0.0, 0.5);
- return LinearGradient(
- colors: const [
- Colors.transparent,
- Colors.black,
- Colors.black,
- Colors.transparent,
- ],
- stops: [0, fadeStop, 1 - fadeStop, 1],
- ).createShader(bounds);
- },
- child: ListView.separated(
- key: const ValueKey("contact-suggestions-scroll"),
- controller: scrollController,
- primary: false,
- scrollDirection: Axis.horizontal,
- padding: const EdgeInsets.symmetric(horizontal: arrowSize),
- itemCount: contacts.length,
- itemBuilder: (context, index) {
- final contact = contacts[index];
- return SizedBox(
- width: itemWidth,
- child: _ContactSuggestion(
- key: ValueKey(
- "contact-${contact.email.trim().toLowerCase()}",
- ),
- suggestion: contact,
- onTap: () => onToggle(contact),
- onLongPress: () => showVerifyIdentitySheet(
- context,
- self: false,
- email: contact.email,
+ child: NotificationListener<ScrollMetricsNotification>(
+ onNotification: (notification) {
+ _updateScrollEdges(notification.metrics);
+ return false;
+ },
+ child: NotificationListener<ScrollNotification>(
+ onNotification: (notification) {
+ _updateScrollEdges(notification.metrics);
+ return false;
+ },
+ child: Stack(
+ children: [
+ Positioned.fill(
+ child: ShaderMask(
+ blendMode: BlendMode.dstIn,
+ shaderCallback: (bounds) {
+ final fadeStop = (arrowSize / bounds.width).clamp(0.0, 0.5);
+ return LinearGradient(
+ colors: const [
+ Colors.transparent,
+ Colors.black,
+ Colors.black,
+ Colors.transparent,
+ ],
+ stops: [0, fadeStop, 1 - fadeStop, 1],
+ ).createShader(bounds);
+ },
+ child: ListView.separated(
+ key: const ValueKey("contact-suggestions-scroll"),
+ controller: widget.scrollController,
+ primary: false,
+ scrollDirection: Axis.horizontal,
+ padding: const EdgeInsets.symmetric(horizontal: arrowSize),
+ itemCount: widget.contacts.length,
+ itemBuilder: (context, index) {
+ final contact = widget.contacts[index];
+ return SizedBox(
+ width: itemWidth,
+ child: _ContactSuggestion(
+ key: ValueKey(
+ "contact-${contact.email.trim().toLowerCase()}",
+ ),
+ suggestion: contact,
+ onTap: () => widget.onToggle(contact),
+ onLongPress: () => showVerifyIdentitySheet(
+ context,
+ self: false,
+ email: contact.email,
+ ),
+ ),
+ );
+ },
+ separatorBuilder: (_, _) =>
+ const SizedBox(width: Spacing.lg),
+ ),
+ ),
+ ),
+ if (_canScrollBack)
+ PositionedDirectional(
+ start: 0,
+ top: 0,
+ child: SizedBox(
+ height: avatarSize,
+ child: Center(
+ child: IconButtonComponent(
+ size: arrowSize,
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ tooltip: context.strings.previous,
+ icon: const HugeIcon(
+ icon: HugeIcons.strokeRoundedArrowLeft01,
+ ),
+ onTap: () => _scroll(context, -scrollStep),
),
),
- );
- },
- separatorBuilder: (_, _) => const SizedBox(width: Spacing.lg),
- ),
- ),
- ),
- PositionedDirectional(
- start: 0,
- top: 0,
- child: SizedBox(
- height: avatarSize,
- child: Center(
- child: IconButtonComponent(
- size: arrowSize,
- variant: IconButtonComponentVariant.primary,
- shouldSurfaceExecutionStates: false,
- tooltip: context.strings.previous,
- icon: const HugeIcon(
- icon: HugeIcons.strokeRoundedArrowLeft01,
),
- onTap: () => _scroll(context, -scrollStep),
),
- ),
- ),
- ),
- PositionedDirectional(
- end: 0,
- top: 0,
- child: SizedBox(
- height: avatarSize,
- child: Center(
- child: IconButtonComponent(
- size: arrowSize,
- variant: IconButtonComponentVariant.primary,
- shouldSurfaceExecutionStates: false,
- tooltip: context.strings.next,
- icon: const HugeIcon(
- icon: HugeIcons.strokeRoundedArrowRight01,
+ if (_canScrollForward)
+ PositionedDirectional(
+ end: 0,
+ top: 0,
+ child: SizedBox(
+ height: avatarSize,
+ child: Center(
+ child: IconButtonComponent(
+ size: arrowSize,
+ variant: IconButtonComponentVariant.primary,
+ shouldSurfaceExecutionStates: false,
+ tooltip: context.strings.next,
+ icon: const HugeIcon(
+ icon: HugeIcons.strokeRoundedArrowRight01,
+ ),
+ onTap: () => _scroll(context, scrollStep),
+ ),
+ ),
),
- onTap: () => _scroll(context, scrollStep),
),
- ),
- ),
+ ],
),
- ],
+ ),
),
);
}
+ void _updateScrollEdges(ScrollMetrics metrics) {
+ final canScrollBack = metrics.extentBefore > 0;
+ final canScrollForward = metrics.extentAfter > 0;
+ if (canScrollBack == _canScrollBack &&
+ canScrollForward == _canScrollForward) {
+ return;
+ }
+ setState(() {
+ _canScrollBack = canScrollBack;
+ _canScrollForward = canScrollForward;
+ });
+ }
+
Future<void> _scroll(BuildContext context, double offset) async {
- if (!scrollController.hasClients) {
+ if (!widget.scrollController.hasClients) {
return;
}
- final position = scrollController.position;
+ final position = widget.scrollController.position;
final target = (position.pixels + offset)
.clamp(position.minScrollExtent, position.maxScrollExtent)
.toDouble();
if (MediaQuery.disableAnimationsOf(context)) {
- scrollController.jumpTo(target);
+ widget.scrollController.jumpTo(target);
return;
}
- await scrollController.animateTo(
+ await widget.scrollController.animateTo(
target,
duration: Motion.slow,
curve: Curves.easeOutCubic,
diff --git a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
index 9d73480fc0..97991216c8 100644
--- a/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
+++ b/mobile/apps/photos/lib/ui/sharing/share_collection_page.dart
@@ -78,11 +78,36 @@ class _ShareCollectionPageState extends State<ShareCollectionPage> {
children.addAll([
if (sortedSharees.isNotEmpty)
_participantRoster(userID, sortedSharees)
- else ...[
- Center(child: Image.asset("assets/on_device.png")),
- if (!hasUrl)
- ShareSectionDescription(context.strings.emptyAlbumShareMessage),
- ],
+ else
+ ConstrainedBox(
+ constraints: const BoxConstraints(minHeight: 145),
+ child: Padding(
+ padding: const EdgeInsets.symmetric(vertical: Spacing.xl),
+ child: Column(
+ mainAxisSize: MainAxisSize.min,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Image.asset(
+ "assets/empty_album_sharing.png",
+ width: 76,
+ height: 52,
+ excludeFromSemantics: true,
+ ),
+ const SizedBox(height: Spacing.md),
+ SizedBox(
+ width: 221,
+ child: Text(
+ context.strings.emptyAlbumShareMessage,
+ textAlign: TextAlign.center,
+ style: TextStyles.body.copyWith(
+ color: context.componentColors.textLight,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
const SizedBox(height: Spacing.sm),
ButtonComponent(
label: context.strings.addPerson,
diff --git a/mobile/apps/photos/lib/ui/sharing/widgets/selected_person_chip.dart b/mobile/apps/photos/lib/ui/sharing/widgets/selected_person_chip.dart
index bcfb2602e2..abaa870bf0 100644
--- a/mobile/apps/photos/lib/ui/sharing/widgets/selected_person_chip.dart
+++ b/mobile/apps/photos/lib/ui/sharing/widgets/selected_person_chip.dart
@@ -1,3 +1,4 @@
+import "dart:async";
import "dart:math" as math;
import "package:ente_components/ente_components.dart";
@@ -7,8 +8,9 @@ import "package:photos/models/api/collection/user.dart";
import "package:photos/services/contacts/contact_identity_resolver.dart";
import "package:photos/ui/sharing/share_components.dart";
import "package:photos/ui/sharing/user_avator_widget.dart";
+import "package:photos/ui/sharing/widgets/sharing_role.dart";
-class SelectedRecipientChips extends StatelessWidget {
+class SelectedRecipientChips extends StatefulWidget {
const SelectedRecipientChips({
super.key,
required this.suggestions,
@@ -28,17 +30,45 @@ class SelectedRecipientChips extends StatelessWidget {
final ScrollController scrollController;
final int maxVisibleRows;
+ @override
+ State<SelectedRecipientChips> createState() => _SelectedRecipientChipsState();
+}
+
+class _SelectedRecipientChipsState extends State<SelectedRecipientChips> {
+ // Keep outgoing chips in the layout until their exit animation completes.
+ late final _displayedSuggestions = List<UserSuggestion>.of(
+ widget.suggestions,
+ );
+
+ @override
+ void didUpdateWidget(covariant SelectedRecipientChips oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ for (final suggestion in widget.suggestions) {
+ final index = _displayedSuggestions.indexWhere(
+ (displayed) =>
+ normalizedSharingEmail(displayed.email) ==
+ normalizedSharingEmail(suggestion.email),
+ );
+ if (index == -1) {
+ _displayedSuggestions.add(suggestion);
+ } else {
+ _displayedSuggestions[index] = suggestion;
+ }
+ }
+ }
+
@override
Widget build(BuildContext context) {
final chipExtent = SelectedRecipientChips.chipExtent(context);
final maxViewportHeight =
- maxVisibleRows * chipExtent + (maxVisibleRows - 1) * Spacing.sm;
+ widget.maxVisibleRows * chipExtent +
+ (widget.maxVisibleRows - 1) * Spacing.sm;
return AnimatedSize(
duration: Motion.standard,
curve: Curves.easeOutCubic,
alignment: AlignmentDirectional.topStart,
- child: suggestions.isEmpty
+ child: _displayedSuggestions.isEmpty
? const SizedBox.shrink()
: Padding(
padding: const EdgeInsets.only(bottom: Spacing.xl),
@@ -58,10 +88,10 @@ class SelectedRecipientChips extends StatelessWidget {
child: shareScrollbar(
context,
key: const ValueKey("selected-people-scrollbar"),
- controller: scrollController,
+ controller: widget.scrollController,
child: SingleChildScrollView(
key: const ValueKey("selected-people-scroll"),
- controller: scrollController,
+ controller: widget.scrollController,
primary: false,
padding: const EdgeInsetsDirectional.only(
end: Spacing.md,
@@ -70,18 +100,21 @@ class SelectedRecipientChips extends StatelessWidget {
spacing: Spacing.sm,
runSpacing: Spacing.sm,
children: [
- for (final suggestion in suggestions)
+ for (final suggestion in _displayedSuggestions)
SelectedPersonChip(
key: ValueKey(
suggestion.email.trim().toLowerCase(),
),
suggestion: suggestion,
- onRemove: onRemove == null
+ isRemoving: !_isSelected(suggestion),
+ onRemovalComplete: () =>
+ _finishRemoval(suggestion),
+ onRemove: widget.onRemove == null
? null
- : () => onRemove!(suggestion),
- onLongPress: onLongPress == null
+ : () => _remove(suggestion),
+ onLongPress: widget.onLongPress == null
? null
- : () => onLongPress!(suggestion),
+ : () => widget.onLongPress!(suggestion),
),
],
),
@@ -93,17 +126,44 @@ class SelectedRecipientChips extends StatelessWidget {
),
);
}
+
+ bool _isSelected(UserSuggestion suggestion) => widget.suggestions.any(
+ (selected) =>
+ normalizedSharingEmail(selected.email) ==
+ normalizedSharingEmail(suggestion.email),
+ );
+
+ void _remove(UserSuggestion suggestion) {
+ if (_isSelected(suggestion)) {
+ widget.onRemove!(suggestion);
+ }
+ }
+
+ void _finishRemoval(UserSuggestion suggestion) {
+ if (_isSelected(suggestion)) return;
+ setState(() {
+ _displayedSuggestions.removeWhere(
+ (displayed) =>
+ normalizedSharingEmail(displayed.email) ==
+ normalizedSharingEmail(suggestion.email),
+ );
+ });
+ }
}
class SelectedPersonChip extends StatefulWidget {
const SelectedPersonChip({
super.key,
required this.suggestion,
+ required this.isRemoving,
+ required this.onRemovalComplete,
this.onRemove,
this.onLongPress,
});
final UserSuggestion suggestion;
+ final bool isRemoving;
+ final VoidCallback onRemovalComplete;
final VoidCallback? onRemove;
final VoidCallback? onLongPress;
@@ -115,7 +175,6 @@ class _SelectedPersonChipState extends State<SelectedPersonChip>
with SingleTickerProviderStateMixin {
late final AnimationController _controller;
late final CurvedAnimation _animation;
- bool _isRemoving = false;
@override
void initState() {
@@ -128,6 +187,17 @@ class _SelectedPersonChipState extends State<SelectedPersonChip>
_controller.forward();
}
+ @override
+ void didUpdateWidget(covariant SelectedPersonChip oldWidget) {
+ super.didUpdateWidget(oldWidget);
+ if (widget.isRemoving == oldWidget.isRemoving) return;
+ if (widget.isRemoving) {
+ unawaited(_animateRemoval());
+ } else {
+ _controller.forward();
+ }
+ }
+
@override
void dispose() {
_animation.dispose();
@@ -135,83 +205,85 @@ class _SelectedPersonChipState extends State<SelectedPersonChip>
super.dispose();
}
- Future<void> _remove() async {
- if (_isRemoving || widget.onRemove == null) {
- return;
- }
- _isRemoving = true;
+ Future<void> _animateRemoval() async {
await _controller.reverse();
- if (mounted) {
- widget.onRemove!();
+ if (mounted && widget.isRemoving) {
+ widget.onRemovalComplete();
}
}
@override
Widget build(BuildContext context) {
final label = resolveSuggestionDisplayName(widget.suggestion);
- return AnimatedBuilder(
- key: ValueKey(
- "selected-person-chip-${widget.suggestion.email.trim().toLowerCase()}",
- ),
- animation: _animation,
- child: GestureDetector(
- behavior: HitTestBehavior.opaque,
- onLongPress: widget.onLongPress,
- child: Container(
- constraints: BoxConstraints(
- minHeight: SelectedRecipientChips.chipExtent(context),
- ),
- padding: const EdgeInsets.symmetric(
- horizontal: Spacing.sm,
- vertical: Spacing.xs,
+ return IgnorePointer(
+ ignoring: widget.isRemoving,
+ child: ExcludeSemantics(
+ excluding: widget.isRemoving,
+ child: AnimatedBuilder(
+ key: ValueKey(
+ "selected-person-chip-${widget.suggestion.email.trim().toLowerCase()}",
),
- decoration: BoxDecoration(
- color: context.componentColors.fillLight,
- borderRadius: BorderRadius.circular(Radii.button),
- ),
- child: Row(
- mainAxisSize: MainAxisSize.min,
- children: [
- UserAvatarWidget.suggestion(
- widget.suggestion,
- type: AvatarType.medium,
+ animation: _animation,
+ child: GestureDetector(
+ behavior: HitTestBehavior.opaque,
+ onLongPress: widget.onLongPress,
+ child: Container(
+ constraints: BoxConstraints(
+ minHeight: SelectedRecipientChips.chipExtent(context),
+ ),
+ padding: const EdgeInsets.symmetric(
+ horizontal: Spacing.sm,
+ vertical: Spacing.xs,
),
- const SizedBox(width: Spacing.sm),
- Flexible(
- child: Text(
- label,
- maxLines: 1,
- overflow: TextOverflow.ellipsis,
- style: TextStyles.mini,
- ),
+ decoration: BoxDecoration(
+ color: context.componentColors.fillLight,
+ borderRadius: BorderRadius.circular(Radii.button),
),
- if (widget.onRemove != null) ...[
- const SizedBox(width: Spacing.xs),
- GestureDetector(
- key: ValueKey(
- "remove-${widget.suggestion.email.trim().toLowerCase()}",
+ child: Row(
+ mainAxisSize: MainAxisSize.min,
+ children: [
+ UserAvatarWidget.suggestion(
+ widget.suggestion,
+ type: AvatarType.medium,
),
- behavior: HitTestBehavior.opaque,
- onTap: _remove,
- child: const Padding(
- padding: EdgeInsets.all(Spacing.xs),
- child: HugeIcon(
- icon: HugeIcons.strokeRoundedCancel01,
- size: IconSizes.small,
+ const SizedBox(width: Spacing.sm),
+ Flexible(
+ child: Text(
+ label,
+ maxLines: 1,
+ overflow: TextOverflow.ellipsis,
+ style: TextStyles.mini,
),
),
- ),
- ],
- ],
+ if (widget.onRemove != null) ...[
+ const SizedBox(width: Spacing.xs),
+ GestureDetector(
+ key: ValueKey(
+ "remove-${widget.suggestion.email.trim().toLowerCase()}",
+ ),
+ behavior: HitTestBehavior.opaque,
+ onTap: widget.onRemove,
+ child: const Padding(
+ padding: EdgeInsets.all(Spacing.xs),
+ child: HugeIcon(
+ icon: HugeIcons.strokeRoundedCancel01,
+ size: IconSizes.small,
+ ),
+ ),
+ ),
+ ],
+ ],
+ ),
+ ),
+ ),
+ builder: (context, child) => Opacity(
+ opacity: _animation.value,
+ child: Transform.scale(
+ scale: 0.96 + 0.04 * _animation.value,
+ alignment: AlignmentDirectional.centerStart,
+ child: child,
+ ),
),
- ),
- ),
- builder: (context, child) => Opacity(
- opacity: _animation.value,
- child: Transform.scale(
- scale: 0.96 + 0.04 * _animation.value,
- alignment: AlignmentDirectional.centerStart,
- child: child,
),
),
);
diff --git a/mobile/packages/strings/lib/l10n/arb/strings_en.arb b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
index 8cd2cf972f..9c710fd00f 100644
--- a/mobile/packages/strings/lib/l10n/arb/strings_en.arb
+++ b/mobile/packages/strings/lib/l10n/arb/strings_en.arb
@@ -5007,7 +5007,7 @@
"youAreViewer": "You are a viewer",
"youAreCollaborator": "You are a collaborator",
"youAreAdmin": "You are an admin",
- "emptyAlbumShareMessage": "You have not shared this album with anyone yet.",
+ "emptyAlbumShareMessage": "Add a person to\nshare your album with them",
"addPeople": "Add people",
"fromYourContacts": "From your contacts",
"chooseAccess": "Choose access",