Skip to content

Commit

Permalink
TF-2666 Edit one recipient in To/Cc/Bcc on mobile
Browse files Browse the repository at this point in the history
  • Loading branch information
dab246 committed Dec 2, 2024
1 parent c13fba3 commit 526238d
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/features/composer/presentation/composer_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ class ComposerView extends GetWidget<ComposerController> {
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEnableAllRecipientsInputAction: controller.handleEnableRecipientsInputAction,
onEditRecipientAction: controller.onEditRecipient,
)),
Obx(() {
if (controller.ccRecipientState.value == PrefixRecipientState.enabled) {
Expand All @@ -170,6 +171,7 @@ class ComposerView extends GetWidget<ComposerController> {
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEditRecipientAction: controller.onEditRecipient,
);
} else {
return const SizedBox.shrink();
Expand Down Expand Up @@ -199,6 +201,7 @@ class ComposerView extends GetWidget<ComposerController> {
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEditRecipientAction: controller.onEditRecipient,
);
} else {
return const SizedBox.shrink();
Expand Down Expand Up @@ -310,6 +313,7 @@ class ComposerView extends GetWidget<ComposerController> {
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEnableAllRecipientsInputAction: controller.handleEnableRecipientsInputAction,
onEditRecipientAction: controller.onEditRecipient,
),
if (controller.ccRecipientState.value == PrefixRecipientState.enabled)
RecipientComposerWidget(
Expand All @@ -334,6 +338,7 @@ class ComposerView extends GetWidget<ComposerController> {
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEditRecipientAction: controller.onEditRecipient,
),
if (controller.bccRecipientState.value == PrefixRecipientState.enabled)
RecipientComposerWidget(
Expand All @@ -358,6 +363,7 @@ class ComposerView extends GetWidget<ComposerController> {
onUpdateListEmailAddressAction: controller.updateListEmailAddress,
onSuggestionEmailAddress: controller.getAutoCompleteSuggestion,
onFocusNextAddressAction: controller.handleFocusNextAddressAction,
onEditRecipientAction: controller.onEditRecipient,
),
],
)),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ class _RecipientComposerWidgetState extends State<RecipientComposerWidget> {
maxWidth: widget.maxWidth,
onDeleteTagAction: (emailAddress) => _handleDeleteTagAction.call(emailAddress, stateSetter),
onShowFullAction: widget.onShowFullListEmailAddressAction,
onEditRecipientAction: widget.onEditRecipientAction,
);
},
onTagChanged: (value) => _handleOnTagChangeAction.call(value, stateSetter),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ class RecipientTagItemWidget extends StatelessWidget {
onDoubleTap: _handleDoubleTapAction,
child: tagWidget,
);
} else if (PlatformInfo.isMobile) {
tagWidget = GestureDetector(
onLongPress: _handleLongPressAction,
child: tagWidget,
);
}

if (PlatformInfo.isWeb || isTestingForWeb) {
Expand Down Expand Up @@ -178,4 +183,8 @@ class RecipientTagItemWidget extends StatelessWidget {
void _handleDoubleTapAction() {
onEditRecipientAction?.call(prefix, currentEmailAddress);
}

void _handleLongPressAction() {
onEditRecipientAction?.call(prefix, currentEmailAddress);
}
}

0 comments on commit 526238d

Please sign in to comment.