@@ -86,35 +86,43 @@ class _HomePageState extends State<HomePage> {
8686
8787 @override
8888 Widget build (BuildContext context) {
89+ final zulipLocalizations = ZulipLocalizations .of (context);
90+
8991 const pageBodies = [
9092 (_HomePageTab .inbox, InboxPageBody ()),
9193 (_HomePageTab .channels, SubscriptionListPageBody ()),
9294 // TODO(#1094): Users
9395 (_HomePageTab .directMessages, RecentDmConversationsPageBody ()),
9496 ];
9597
96- _NavigationBarButton button (_HomePageTab tab, IconData icon) {
98+ _NavigationBarButton button (_HomePageTab tab, IconData icon, String label ) {
9799 return _NavigationBarButton (icon: icon,
98100 selected: _tab.value == tab,
99101 onPressed: () {
100102 _tab.value = tab;
101- });
103+ },
104+ label: label);
102105 }
103106
104107 // TODO(a11y): add tooltips for these buttons
105108 final navigationBarButtons = [
106- button (_HomePageTab .inbox, ZulipIcons .inbox),
109+ button (_HomePageTab .inbox, ZulipIcons .inbox,
110+ zulipLocalizations.inboxPageTitle),
107111 _NavigationBarButton ( icon: ZulipIcons .message_feed,
108112 selected: false ,
109113 onPressed: () => Navigator .push (context,
110114 MessageListPage .buildRoute (context: context,
111- narrow: const CombinedFeedNarrow ()))),
112- button (_HomePageTab .channels, ZulipIcons .hash_italic),
115+ narrow: const CombinedFeedNarrow ())),
116+ label: zulipLocalizations.navBarFeedLabel),
117+ button (_HomePageTab .channels, ZulipIcons .hash_italic,
118+ zulipLocalizations.channelsPageTitle),
113119 // TODO(#1094): Users
114- button (_HomePageTab .directMessages, ZulipIcons .two_person),
120+ button (_HomePageTab .directMessages, ZulipIcons .two_person,
121+ zulipLocalizations.navBarDmLabel),
115122 _NavigationBarButton ( icon: ZulipIcons .menu,
116123 selected: false ,
117- onPressed: () => _showMainMenu (context, tabNotifier: _tab)),
124+ onPressed: () => _showMainMenu (context, tabNotifier: _tab),
125+ label: zulipLocalizations.navBarMenuLabel),
118126 ];
119127
120128 final designVariables = DesignVariables .of (context);
@@ -134,7 +142,8 @@ class _HomePageState extends State<HomePage> {
134142 border: Border (top: BorderSide (color: designVariables.borderBar)),
135143 color: designVariables.bgBotBar),
136144 child: SafeArea (
137- child: SizedBox (height: 48 ,
145+ child: SizedBox (
146+ height: 62 ,
138147 child: Center (
139148 child: ConstrainedBox (
140149 // TODO(design): determine a suitable max width for bottom nav bar
@@ -231,35 +240,46 @@ class _NavigationBarButton extends StatelessWidget {
231240 required this .icon,
232241 required this .selected,
233242 required this .onPressed,
243+ required this .label,
234244 });
235245
236246 final IconData icon;
237247 final bool selected;
238248 final void Function () onPressed;
249+ final String label;
239250
240251 @override
241252 Widget build (BuildContext context) {
242253 final designVariables = DesignVariables .of (context);
243254
244- final iconColor = WidgetStateColor .fromMap ({
245- WidgetState .pressed: designVariables.iconSelected,
246- ~ WidgetState .pressed: selected ? designVariables.iconSelected
247- : designVariables.icon,
248- });
255+ final color = selected ? designVariables.iconSelected : designVariables.icon;
249256
250257 return AnimatedScaleOnTap (
251258 scaleEnd: 0.875 ,
252259 duration: const Duration (milliseconds: 100 ),
253- child: IconButton (
254- icon: Icon (icon, size: 24 ),
255- onPressed: onPressed,
256- style: IconButton .styleFrom (
257- // TODO(#417): Disable splash effects for all buttons globally.
258- splashFactory: NoSplash .splashFactory,
259- highlightColor: designVariables.navigationButtonBg,
260- shape: const RoundedRectangleBorder (
261- borderRadius: BorderRadius .all (Radius .circular (4 ))),
262- ).copyWith (foregroundColor: iconColor)));
260+ child: GestureDetector (
261+ behavior: HitTestBehavior .opaque,
262+ onTap: onPressed,
263+ child: Column (
264+ children: [
265+ SizedBox (
266+ height: 34 ,
267+ child: Center (
268+ child: Icon (icon, size: 24 , color: color,)),
269+ ),
270+ Expanded (
271+ child: Text (
272+ label,
273+ style: TextStyle (
274+ fontSize: 12 ,
275+ color: color,
276+ height: 1.0 ,),
277+ textAlign: TextAlign .center,
278+ maxLines: 2 ,
279+ overflow: TextOverflow .ellipsis),
280+ )
281+ ]),
282+ ));
263283 }
264284}
265285
0 commit comments