Skip to content
Open
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
12 changes: 12 additions & 0 deletions assets/l10n/app_en.arb
Original file line number Diff line number Diff line change
Expand Up @@ -1231,6 +1231,18 @@
"@wildcardMentionTopicDescription": {
"description": "Description for \"@topic\" wildcard-mention autocomplete options when writing a channel message."
},
"navBarFeedLabel": "Combined Feed",
"@navBarFeedLabel": {
"description": "Label for the Feed button on the bottom navigation bar."
},
"navBarDmLabel": "DMs",
"@navBarDmLabel": {
"description": "Label for the Direct Messages button on the bottom navigation bar."
},
"navBarMenuLabel": "Menu",
"@navBarMenuLabel": {
"description": "Label for the Menu button on the bottom navigation bar."
},
"messageIsEditedLabel": "EDITED",
"@messageIsEditedLabel": {
"description": "Label for an edited message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)"
Expand Down
18 changes: 18 additions & 0 deletions lib/generated/l10n/zulip_localizations.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1791,6 +1791,24 @@ abstract class ZulipLocalizations {
/// **'Notify topic'**
String get wildcardMentionTopicDescription;

/// Label for the Feed button on the bottom navigation bar.
///
/// In en, this message translates to:
/// **'Combined Feed'**
String get navBarFeedLabel;

/// Label for the Direct Messages button on the bottom navigation bar.
///
/// In en, this message translates to:
/// **'DMs'**
String get navBarDmLabel;

/// Label for the Menu button on the bottom navigation bar.
///
/// In en, this message translates to:
/// **'Menu'**
String get navBarMenuLabel;

/// Label for an edited message. (Use ALL CAPS for cased alphabets: Latin, Greek, Cyrillic, etc.)
///
/// In en, this message translates to:
Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_ar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,15 @@ class ZulipLocalizationsAr extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'إخطار الموضوع';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_de.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1050,6 +1050,15 @@ class ZulipLocalizationsDe extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Thema benachrichtigen';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'BEARBEITET';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_en.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,15 @@ class ZulipLocalizationsEn extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_fr.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,15 @@ class ZulipLocalizationsFr extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_it.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,15 @@ class ZulipLocalizationsIt extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notifica argomento';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'MODIFICATO';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_ja.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,15 @@ class ZulipLocalizationsJa extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'トピック参加者に通知';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => '編集済み';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_nb.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,15 @@ class ZulipLocalizationsNb extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_pl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1042,6 +1042,15 @@ class ZulipLocalizationsPl extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Powiadom w wątku';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'ZMIENIONO';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_ru.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,15 @@ class ZulipLocalizationsRu extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Оповестить тему';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'ИЗМЕНЕНО';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_sk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1029,6 +1029,15 @@ class ZulipLocalizationsSk extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'UPRAVENÉ';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_sl.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1064,6 +1064,15 @@ class ZulipLocalizationsSl extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Obvesti udeležence teme';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'UREJENO';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_uk.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1043,6 +1043,15 @@ class ZulipLocalizationsUk extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Повідомити канал';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'РЕДАГОВАНО';

Expand Down
9 changes: 9 additions & 0 deletions lib/generated/l10n/zulip_localizations_zh.dart
Original file line number Diff line number Diff line change
Expand Up @@ -1027,6 +1027,15 @@ class ZulipLocalizationsZh extends ZulipLocalizations {
@override
String get wildcardMentionTopicDescription => 'Notify topic';

@override
String get navBarFeedLabel => 'Combined Feed';

@override
String get navBarDmLabel => 'DMs';

@override
String get navBarMenuLabel => 'Menu';

@override
String get messageIsEditedLabel => 'EDITED';

Expand Down
75 changes: 48 additions & 27 deletions lib/widgets/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -86,35 +86,43 @@ class _HomePageState extends State<HomePage> {

@override
Widget build(BuildContext context) {
final zulipLocalizations = ZulipLocalizations.of(context);

const pageBodies = [
(_HomePageTab.inbox, InboxPageBody()),
(_HomePageTab.channels, SubscriptionListPageBody()),
// TODO(#1094): Users
(_HomePageTab.directMessages, RecentDmConversationsPageBody()),
];

_NavigationBarButton button(_HomePageTab tab, IconData icon) {
_NavigationBarButton button(_HomePageTab tab, IconData icon, String label) {
return _NavigationBarButton(icon: icon,
selected: _tab.value == tab,
onPressed: () {
_tab.value = tab;
});
},
label: label);
}

// TODO(a11y): add tooltips for these buttons
final navigationBarButtons = [
button(_HomePageTab.inbox, ZulipIcons.inbox),
button(_HomePageTab.inbox, ZulipIcons.inbox,
zulipLocalizations.inboxPageTitle),
_NavigationBarButton( icon: ZulipIcons.message_feed,
selected: false,
onPressed: () => Navigator.push(context,
MessageListPage.buildRoute(context: context,
narrow: const CombinedFeedNarrow()))),
button(_HomePageTab.channels, ZulipIcons.hash_italic),
narrow: const CombinedFeedNarrow())),
label: zulipLocalizations.navBarFeedLabel),
button(_HomePageTab.channels, ZulipIcons.hash_italic,
zulipLocalizations.channelsPageTitle),
// TODO(#1094): Users
button(_HomePageTab.directMessages, ZulipIcons.two_person),
button(_HomePageTab.directMessages, ZulipIcons.two_person,
zulipLocalizations.navBarDmLabel),
_NavigationBarButton( icon: ZulipIcons.menu,
selected: false,
onPressed: () => _showMainMenu(context, tabNotifier: _tab)),
onPressed: () => _showMainMenu(context, tabNotifier: _tab),
label: zulipLocalizations.navBarMenuLabel),
];

final designVariables = DesignVariables.of(context);
Expand All @@ -124,17 +132,19 @@ class _HomePageState extends State<HomePage> {
body: Stack(
children: [
for (final (tab, body) in pageBodies)
// TODO(#535): Decide if we find it helpful to use something like
// [SemanticsProperties.namesRoute] to structure this UI better
// for screen-reader software.
Offstage(offstage: tab != _tab.value, child: body),
Offstage(
offstage: tab != _tab.value,
child: Semantics(
namesRoute: true,
child: body))
]),
bottomNavigationBar: DecoratedBox(
decoration: BoxDecoration(
border: Border(top: BorderSide(color: designVariables.borderBar)),
color: designVariables.bgBotBar),
child: SafeArea(
child: SizedBox(height: 48,
child: SizedBox(
height: 62,
child: Center(
child: ConstrainedBox(
// TODO(design): determine a suitable max width for bottom nav bar
Expand Down Expand Up @@ -231,35 +241,46 @@ class _NavigationBarButton extends StatelessWidget {
required this.icon,
required this.selected,
required this.onPressed,
required this.label,
});

final IconData icon;
final bool selected;
final void Function() onPressed;
final String label;

@override
Widget build(BuildContext context) {
final designVariables = DesignVariables.of(context);

final iconColor = WidgetStateColor.fromMap({
WidgetState.pressed: designVariables.iconSelected,
~WidgetState.pressed: selected ? designVariables.iconSelected
: designVariables.icon,
});
final color = selected ? designVariables.iconSelected : designVariables.icon;

return AnimatedScaleOnTap(
scaleEnd: 0.875,
duration: const Duration(milliseconds: 100),
child: IconButton(
icon: Icon(icon, size: 24),
onPressed: onPressed,
style: IconButton.styleFrom(
// TODO(#417): Disable splash effects for all buttons globally.
splashFactory: NoSplash.splashFactory,
highlightColor: designVariables.navigationButtonBg,
shape: const RoundedRectangleBorder(
borderRadius: BorderRadius.all(Radius.circular(4))),
).copyWith(foregroundColor: iconColor)));
child: GestureDetector(
behavior: HitTestBehavior.opaque,
onTap: onPressed,
child: Column(
children: [
SizedBox(
height: 34,
child: Center(
child: Icon(icon, size: 24, color: color,)),
),
Expanded(
child: Text(
label,
style: TextStyle(
fontSize: 12,
color: color,
height: 1.0,),
textAlign: TextAlign.center,
maxLines: 2,
overflow: TextOverflow.ellipsis),
)
]),
));
}
}

Expand Down
Loading