diff --git a/lib/widgets/emoji_reaction.dart b/lib/widgets/emoji_reaction.dart index f747f533e9..f494b02e79 100644 --- a/lib/widgets/emoji_reaction.dart +++ b/lib/widgets/emoji_reaction.dart @@ -554,10 +554,8 @@ class _EmojiPickerState extends State with PerAccountStoreAwareStat padding: const EdgeInsets.symmetric(horizontal: 8), splashFactory: NoSplash.splashFactory, foregroundColor: designVariables.contextMenuItemText, - ).copyWith(backgroundColor: WidgetStateColor.resolveWith((states) => - states.contains(WidgetState.pressed) - ? designVariables.contextMenuItemBg.withFadedAlpha(0.20) - : Colors.transparent)), + overlayColor: Colors.transparent, + ), child: Text(zulipLocalizations.dialogCancel, style: const TextStyle(fontSize: 20, height: 30 / 20))), ])), diff --git a/lib/widgets/set_status.dart b/lib/widgets/set_status.dart index 9d28eaca27..4a7c87ae86 100644 --- a/lib/widgets/set_status.dart +++ b/lib/widgets/set_status.dart @@ -8,7 +8,6 @@ import '../basic.dart'; import '../generated/l10n/zulip_localizations.dart'; import '../log.dart'; import 'app_bar.dart'; -import 'color.dart'; import 'emoji_reaction.dart'; import 'icons.dart'; import 'inset_shadow.dart'; @@ -183,85 +182,86 @@ class _SetStatusPageState extends State { }), ], ), - body: Column(children: [ - Padding( - padding: const EdgeInsetsDirectional.only( - // In Figma design, this is 16px, but we compensate for that in - // the icon button below. - start: 8, - top: 8, end: 10, - // In Figma design, this is 4px, be we compensate for that in - // [SingleChildScrollView.padding] below. - bottom: 0), - child: Row( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - IconButton( - onPressed: chooseStatusEmoji, - style: IconButton.styleFrom( - splashFactory: NoSplash.splashFactory, - foregroundColor: designVariables.icon, - tapTargetSize: MaterialTapTargetSize.shrinkWrap, - padding: EdgeInsets.symmetric( - vertical: 8, - // In Figma design, there is no horizontal padding, but we - // provide it in order to create a proper tap target size. - horizontal: 8)), - icon: Row(spacing: 4, children: [ - ValueListenableBuilder( - valueListenable: statusChange, - builder: (_, change, _) { - final emoji = change.emoji.or(oldStatus.emoji); - return emoji == null - ? const Icon(ZulipIcons.smile, size: 24) - : UserStatusEmoji(emoji: emoji, size: 24, neverAnimate: false); - }), - Icon(ZulipIcons.chevron_down, size: 16), - ]), - ), - Expanded(child: TextField( - controller: statusTextController, - minLines: 1, - maxLines: 2, - // The limit on the size of the status text is 60 characters. - // See: https://zulip.com/api/update-status#parameter-status_text - maxLength: 60, - cursorColor: designVariables.textInput, - textCapitalization: TextCapitalization.sentences, - style: TextStyle(fontSize: 19, height: 24 / 19), - decoration: InputDecoration( - // TODO: display a counter as suggested in CZO discussion: - // https://chat.zulip.org/#narrow/channel/530-mobile-design/topic/Set.20user.20status/near/2224549 - counterText: '', - hintText: localizations.statusTextHint, - hintStyle: TextStyle(color: designVariables.labelSearchPrompt), - isDense: true, - contentPadding: EdgeInsets.symmetric( - vertical: 8, - // Subtracting 4 pixels to account for the internal - // 4-pixel horizontal padding. - horizontal: 10 - 4, - ), - filled: true, - fillColor: designVariables.bgSearchInput, - border: OutlineInputBorder( - borderRadius: BorderRadius.circular(10), - borderSide: BorderSide.none, - )))), - ]), - ), - Expanded(child: InsetShadowBox( - top: 6, bottom: 6, - color: designVariables.mainBackground, - child: SingleChildScrollView( - padding: EdgeInsets.symmetric(vertical: 6), - child: Column(children: [ - for (final status in suggestions) - StatusSuggestionsListEntry( - status: status, - onTap: () => chooseStatusSuggestion(status)), - ])))), - ]), + body: SafeArea( + bottom: false, + minimum: EdgeInsets.symmetric(horizontal: 8), + child: Column(children: [ + Padding( + padding: const EdgeInsetsDirectional.only( + top: 8, + // In Figma design, this is 4px, be we compensate for that in + // [SingleChildScrollView.padding] below. + bottom: 0), + child: Row( + spacing: 4, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + IconButton( + onPressed: chooseStatusEmoji, + style: IconButton.styleFrom( + splashFactory: NoSplash.splashFactory, + foregroundColor: designVariables.icon, + tapTargetSize: MaterialTapTargetSize.shrinkWrap, + padding: EdgeInsets.symmetric( + vertical: 8, + // In Figma design, there is no horizontal padding, but we + // provide it in order to create a proper tap target size. + horizontal: 8)), + icon: Row(spacing: 4, children: [ + ValueListenableBuilder( + valueListenable: statusChange, + builder: (_, change, _) { + final emoji = change.emoji.or(oldStatus.emoji); + return emoji == null + ? const Icon(ZulipIcons.smile, size: 24) + : UserStatusEmoji(emoji: emoji, size: 24, neverAnimate: false); + }), + Icon(ZulipIcons.chevron_down, size: 16), + ]), + ), + Expanded(child: TextField( + controller: statusTextController, + minLines: 1, + maxLines: 2, + // The limit on the size of the status text is 60 characters. + // See: https://zulip.com/api/update-status#parameter-status_text + maxLength: 60, + cursorColor: designVariables.textInput, + textCapitalization: TextCapitalization.sentences, + style: TextStyle(fontSize: 19, height: 24 / 19), + decoration: InputDecoration( + // TODO: display a counter as suggested in CZO discussion: + // https://chat.zulip.org/#narrow/channel/530-mobile-design/topic/Set.20user.20status/near/2224549 + counterText: '', + hintText: localizations.statusTextHint, + hintStyle: TextStyle(color: designVariables.labelSearchPrompt), + isDense: true, + contentPadding: EdgeInsets.symmetric( + vertical: 8, + // Subtracting 4 pixels to account for the internal + // 4-pixel horizontal padding. + horizontal: 10 - 4, + ), + filled: true, + fillColor: designVariables.bgSearchInput, + border: OutlineInputBorder( + borderRadius: BorderRadius.circular(10), + borderSide: BorderSide.none, + )))), + ]), + ), + Expanded(child: InsetShadowBox( + top: 6, + color: designVariables.mainBackground, + child: SingleChildScrollView( + padding: EdgeInsets.only(top: 6), + child: Column(children: [ + for (final status in suggestions) + StatusSuggestionsListEntry( + status: status, + onTap: () => chooseStatusSuggestion(status)), + ])))), + ])), ); } } @@ -313,18 +313,11 @@ class StatusSuggestionsListEntry extends StatelessWidget { @override Widget build(BuildContext context) { - final designVariables = DesignVariables.of(context); - - return InkWell( + return GestureDetector( + behavior: HitTestBehavior.opaque, onTap: onTap, - splashFactory: NoSplash.splashFactory, - overlayColor: WidgetStateColor.resolveWith( - (states) => states.any((e) => e == WidgetState.pressed) - ? designVariables.contextMenuItemBg.withFadedAlpha(0.20) - : Colors.transparent, - ), child: Padding( - padding: EdgeInsets.symmetric(vertical: 7, horizontal: 16), + padding: EdgeInsets.symmetric(vertical: 7, horizontal: 8), child: Row( spacing: 8, children: [