Skip to content

Commit

Permalink
ui: Follow Figma in adding app-bar bottom border
Browse files Browse the repository at this point in the history
The default app-bar color is now extremely similar to the scaffold
background color -- Color(0xfff5f5f5) and Color(0xfff6f6f6),
respectively -- and both follow the Figma. Because of their
similarity, it seems helpful to delineate the app bar a bit better,
and we can do so by adding this bottom border, which the Figma has:
  https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?type=design&node-id=143-10772&mode=design&t=Nvsl6UdRBQvH3zXV-0

In the message list, the Figma isn't consistent on whether to omit
the border when the app bar matches the color of all the recipient
headers, like in a stream narrow. I think it's better to omit it in
those cases, so I've done that here.
  • Loading branch information
chrisbobbe committed Feb 21, 2024
1 parent 5eb983f commit 73e21fd
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 2 additions & 0 deletions lib/widgets/app.dart
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class ZulipApp extends StatelessWidget {
// ColorScheme.surface otherwise, and those are different colors.
scrolledUnderElevation: 0,
backgroundColor: Color(0xfff5f5f5),

shape: Border(bottom: BorderSide(color: Color(0xffcccccc))),
),
// This applies Material 3's color system to produce a palette of
// appropriately matching and contrasting colors for use in a UI.
Expand Down
15 changes: 14 additions & 1 deletion lib/widgets/message_list.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,20 +58,33 @@ class _MessageListPageState extends State<MessageListPage> {
final store = PerAccountStoreWidget.of(context);

final Color? backgroundColor;
bool removeAppBarBottomBorder = false;
switch(widget.narrow) {
case AllMessagesNarrow():
backgroundColor = null; // i.e., inherit

case StreamNarrow(:final streamId):
case TopicNarrow(:final streamId):
backgroundColor = store.subscriptions[streamId]?.colorSwatch().barBackground
?? _kUnsubscribedStreamRecipientHeaderColor;
// All recipient headers will match this color; remove distracting line
// (but are recipient headers even needed for topic narrows?)
removeAppBarBottomBorder = true;

case DmNarrow():
backgroundColor = _kDmRecipientHeaderColor;
// All recipient headers will match this color; remove distracting line
// (but are recipient headers even needed?)
removeAppBarBottomBorder = true;
}

return Scaffold(
appBar: AppBar(title: MessageListAppBarTitle(narrow: widget.narrow),
backgroundColor: backgroundColor),
backgroundColor: backgroundColor,
shape: removeAppBarBottomBorder
? const Border()
: null, // i.e., inherit
),
// TODO question for Vlad: for a stream view, should we set
// [backgroundColor] based on stream color, as in this frame:
// https://www.figma.com/file/1JTNtYo9memgW7vV6d0ygq/Zulip-Mobile?node-id=132%3A9684&mode=dev
Expand Down

0 comments on commit 73e21fd

Please sign in to comment.