Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions lib/widgets/emoji_reaction.dart
Original file line number Diff line number Diff line change
Expand Up @@ -554,10 +554,8 @@ class _EmojiPickerState extends State<EmojiPicker> 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))),
])),
Expand Down
173 changes: 83 additions & 90 deletions lib/widgets/set_status.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -183,85 +182,86 @@ class _SetStatusPageState extends State<SetStatusPage> {
}),
],
),
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: [
Comment on lines +185 to +188
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Before this in landscape mode, the content would extend and partially
hide beneath the top notch. Now the content is displayed correctly and
starts just from below the notch.

The reference to "the top notch" is confusing here — the notch in question is on the side, right? Similarly "from below the notch" reinforces that we're talking about the vertical direction. This sounds like it's doing something at the top, but I think it can't do that because the app bar is already occupying the top.

Separately confusing is that this seems to use "beneath" and "below" to refer to two different directions (the z-axis and x-axis), but those terms are synonyms.

I think one way to say this would be:

Before this, the content would be obscured by any insets on the sides, e.g. by a camera notch when in landscape mode. Now it avoids the insets.

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)),
])))),
])),
);
}
}
Expand Down Expand Up @@ -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: [
Expand Down